Kill the surviving glob and breach-directory mutants of item 370
This commit is contained in:
@@ -552,6 +552,15 @@ class EnvFileRead(unittest.TestCase):
|
||||
with self.subTest(command):
|
||||
self.assertEqual(self.breached("Bash", {"command": command}), expected)
|
||||
|
||||
def test_a_glob_matches_a_file_below_the_searched_folder_by_name_or_by_path(self):
|
||||
for command, expected in (("rg -g '*.env' TOKEN ~", ["env-file-read"]), ("rg -g 'acme.en?' TOKEN ~/secrets", ["env-file-read"]), ("rg -g '/secrets/acme.env' TOKEN ~", ["env-file-read"]), ("rg -g 'acme.enx' TOKEN ~/secrets", [])):
|
||||
with self.subTest(command):
|
||||
self.assertEqual(self.breached("Bash", {"command": command}), expected)
|
||||
|
||||
def test_a_search_s_breach_is_logged_in_the_directory_the_command_runs_in(self):
|
||||
found = breaches_of(Call("Bash", {"command": "grep -r TOKEN ~/secrets"}, "/r"), str(self.home), {})
|
||||
self.assertEqual([breach.directory for breach in found[2] if breach.rule == "env-file-read"], ["/r"])
|
||||
|
||||
def test_a_file_several_configs_name_is_reported_once(self):
|
||||
write_config(self.home, self.home / "code" / "other")
|
||||
config = self.home / ".claude-projects" / "other" / "config.toml"
|
||||
|
||||
Reference in New Issue
Block a user