tests/gemini-cli: add policy assertions
Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
9fc7535efc
commit
b61330163e
3 changed files with 26 additions and 0 deletions
5
tests/modules/programs/gemini-cli/my-rules.toml
Normal file
5
tests/modules/programs/gemini-cli/my-rules.toml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[[rule]]
|
||||
commandPrefix = "git "
|
||||
decision = "ask_user"
|
||||
priority = 100
|
||||
toolName = "run_shell_command"
|
||||
4
tests/modules/programs/gemini-cli/other-rules.toml
Normal file
4
tests/modules/programs/gemini-cli/other-rules.toml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
[[rule]]
|
||||
toolName = "read_file"
|
||||
decision = "allow"
|
||||
priority = 50
|
||||
|
|
@ -20,6 +20,19 @@
|
|||
description = "Generates a fix for a given GitHub issue.";
|
||||
};
|
||||
};
|
||||
policies = {
|
||||
"my-rules" = {
|
||||
rule = [
|
||||
{
|
||||
toolName = "run_shell_command";
|
||||
commandPrefix = "git ";
|
||||
decision = "ask_user";
|
||||
priority = 100;
|
||||
}
|
||||
];
|
||||
};
|
||||
"other-rules" = ./other-rules.toml;
|
||||
};
|
||||
};
|
||||
nmt.script = ''
|
||||
assertFileExists home-files/.gemini/settings.json
|
||||
|
|
@ -29,6 +42,10 @@
|
|||
${./changelog.toml}
|
||||
assertFileContent home-files/.gemini/commands/git/fix.toml \
|
||||
${./fix.toml}
|
||||
assertFileContent home-files/.gemini/policies/my-rules.toml \
|
||||
${./my-rules.toml}
|
||||
assertFileContent home-files/.gemini/policies/other-rules.toml \
|
||||
${./other-rules.toml}
|
||||
|
||||
assertFileExists home-path/etc/profile.d/hm-session-vars.sh
|
||||
assertFileContains home-path/etc/profile.d/hm-session-vars.sh \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue