tests/gemini-cli: add policy assertions

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2026-03-12 22:07:17 -05:00
parent 9fc7535efc
commit b61330163e
3 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,5 @@
[[rule]]
commandPrefix = "git "
decision = "ask_user"
priority = 100
toolName = "run_shell_command"

View file

@ -0,0 +1,4 @@
[[rule]]
toolName = "read_file"
decision = "allow"
priority = 50

View file

@ -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 \