@@ -186,8 +186,8 @@ def test_get_actions_that_support_wildcard_arns_only(self):
186
186
"ecr:PutReplicationConfiguration"
187
187
]
188
188
# print(json.dumps(results, indent=4))
189
- for result in results :
190
- self .assertTrue (result in expected_results )
189
+ for item in expected_results :
190
+ self .assertTrue (item in results )
191
191
192
192
# Variant 3: All actions
193
193
output = get_actions_that_support_wildcard_arns_only ("all" )
@@ -220,8 +220,8 @@ def test_get_actions_at_access_level_that_support_wildcard_arns_only(self):
220
220
self .assertListEqual (list_output , ['secretsmanager:ListSecrets' ])
221
221
self .assertListEqual (write_output , [])
222
222
self .assertListEqual (tagging_output , [])
223
- self . assertListEqual ( permissions_output , ["s3:PutAccountPublicAccessBlock" ])
224
-
223
+ for item in ["s3:PutAccountPublicAccessBlock" ]:
224
+ self . assertTrue ( item in permissions_output )
225
225
all_permissions_output = get_actions_at_access_level_that_support_wildcard_arns_only (
226
226
"all" , "Permissions management"
227
227
)
@@ -278,13 +278,17 @@ def test_get_actions_with_arn_type_and_access_level_case_2(self):
278
278
def test_get_actions_with_arn_type_and_access_level_case_3 (self ):
279
279
"""querying.actions.get_actions_with_arn_type_and_access_level with arn type"""
280
280
desired_output = [
281
- 's3:PutAccountPublicAccessBlock'
281
+ 's3:PutAccountPublicAccessBlock' ,
282
+ 's3:PutAccessPointPublicAccessBlock'
282
283
]
283
284
output = get_actions_with_arn_type_and_access_level (
284
285
# "ram", "resource-share", "Write"
285
286
"s3" , "*" , "Permissions management"
286
287
)
287
- self .assertListEqual (desired_output , output )
288
+ print (output )
289
+ for item in desired_output :
290
+ self .assertTrue (item in output )
291
+ # self.assertListEqual(desired_output, output)
288
292
289
293
def test_get_actions_with_arn_type_and_access_level_case_4 (self ):
290
294
"""querying.actions.get_actions_with_arn_type_and_access_level with arn type"""
@@ -300,10 +304,9 @@ def test_get_actions_with_arn_type_and_access_level_case_5(self):
300
304
"""querying.actions.get_actions_with_arn_type_and_access_level with arn type"""
301
305
302
306
output = get_actions_with_arn_type_and_access_level (
303
- "all " , "object" , "List"
307
+ "s3 " , "object" , "List"
304
308
)
305
-
306
- self .assertTrue (len (output ) == 2 )
309
+ self .assertTrue ("s3:ListMultipartUploadParts" in output )
307
310
308
311
def test_get_actions_matching_arn_type_case_1 (self ):
309
312
"""querying.actions.get_actions_matching_arn_type"""
@@ -317,8 +320,8 @@ def test_get_actions_matching_arn_type_case_1(self):
317
320
]
318
321
results = get_actions_matching_arn_type ('ecr' , '*' )
319
322
print (json .dumps (results , indent = 4 ))
320
- for result in results :
321
- self .assertTrue (result in expected_results )
323
+ for item in expected_results :
324
+ self .assertTrue (item in results )
322
325
# self.assertEqual(output, ["ecr:GetAuthorizationToken"])
323
326
324
327
def test_get_actions_matching_arn_type_case_2 (self ):
0 commit comments