@@ -17,27 +17,33 @@ def make_policy_file(policy_dict):
1717def test_validate_file_success ():
1818 path = make_policy_file ({
1919 "Version" : "2012-10-17" ,
20- "Statement" : [{"Effect" : "Allow" , "Action" : "s3:GetObject" , "Resource" : "arn:aws:s3:::bucket/*" }]
20+ "Statement" : [{
21+ "Effect" : "Allow" ,
22+ "Action" : "s3:GetObject" ,
23+ "Resource" : "arn:aws:s3:::my-bucket/my-object.txt"
24+
25+ }]
2126 })
22- result = runner .invoke (app , ["validate" , "file" , path ])
27+ result = runner .invoke (app , ["validate" , path ])
2328 assert result .exit_code == 0
24- assert "✅" in result .output
2529 os .remove (path )
2630
31+
32+
2733def test_validate_file_error ():
2834 path = make_policy_file ({
2935 "Version" : "2012-10-17" ,
3036 "Statement" : [{"Effect" : "Allow" , "Action" : "*" , "Resource" : "*" }]
3137 })
32- result = runner .invoke (app , ["validate" , "file" , path ])
38+ result = runner .invoke (app , ["validate" , path ])
3339 assert result .exit_code == 1
3440 assert "❌" in result .output
3541 os .remove (path )
3642
3743def test_validate_file_missing ():
38- result = runner .invoke (app , ["validate" , "file" , " no_such_file.json" ])
44+ result = runner .invoke (app , ["validate" , "no_such_file.json" ])
3945 assert result .exit_code == 1
40- assert "File not found" in result .output
46+ assert "not found" in result .output
4147
4248def test_validate_folder_all_valid (tmp_path ):
4349 valid = {
@@ -48,7 +54,7 @@ def test_validate_folder_all_valid(tmp_path):
4854 path = tmp_path / f"v{ i } .json"
4955 path .write_text (json .dumps (valid ))
5056
51- result = runner .invoke (app , ["validate" , "folder" , str (tmp_path )])
57+ result = runner .invoke (app , ["validate" , str (tmp_path )])
5258 assert result .exit_code == 0
5359 assert "✅" in result .output
5460
@@ -64,7 +70,7 @@ def test_validate_folder_with_errors(tmp_path):
6470 (tmp_path / "good.json" ).write_text (json .dumps (good ))
6571 (tmp_path / "bad.json" ).write_text (json .dumps (bad ))
6672
67- result = runner .invoke (app , ["validate" , "folder" , str (tmp_path )])
73+ result = runner .invoke (app , ["validate" , str (tmp_path )])
6874 assert result .exit_code == 1
6975 assert "❌" in result .output
7076
@@ -76,9 +82,9 @@ def test_cli_help():
7682def test_cli_root_help ():
7783 result = runner .invoke (app , ["--help" ])
7884 assert result .exit_code == 0
79- assert "Devolv CLI - Modular DevOps Toolkit" in result .output
85+ assert "Modular DevOps Toolkit" in result .output
8086
8187def test_cli_version ():
82- result = runner .invoke (app , ["version" ])
88+ result = runner .invoke (app , ["-- version" ])
8389 assert result .exit_code == 0
84- assert "v0 .1.0 " in result .output
90+ assert "0 .1." in result .output # Adjust if dynamic version
0 commit comments