@@ -9,42 +9,36 @@ class TestActionExpansion:
9
9
10
10
def test_expand_action_no_expansion (self ):
11
11
expanded_actions = expand_action ("s3:listallmybuckets" )
12
- assert (
13
- len (expanded_actions ),
14
- len ([{"service" : "s3" , "action" : "ListAllMyBuckets" }]),
12
+ assert len (expanded_actions ) == len (
13
+ [{"service" : "s3" , "action" : "ListAllMyBuckets" }]
15
14
)
16
15
17
16
def test_expand_action_with_expansion (self ):
18
17
expanded_actions = expand_action ("s3:listallmybucke*" )
19
- assert (
20
- len (expanded_actions ),
21
- len ([{"service" : "s3" , "action" : "ListAllMyBuckets" }]),
18
+ assert len (expanded_actions ) == len (
19
+ [{"service" : "s3" , "action" : "ListAllMyBuckets" }]
22
20
)
23
21
24
22
def test_expand_action_with_casing (self ):
25
23
expanded_actions = expand_action ("iAm:li*sTuS*rs" )
26
- assert ( len (expanded_actions ), len ([{"service" : "iam" , "action" : "ListUsers" }]) )
24
+ assert len (expanded_actions ) == len ([{"service" : "iam" , "action" : "ListUsers" }])
27
25
28
26
def test_expand_action_with_expansion_for_prefix_used_multiple_times (self ):
29
27
expanded_actions = expand_action ("ses:Describe*" )
30
- assert (
31
- len (expanded_actions ),
32
- len (
33
- [
34
- {"service" : "ses" , "action" : "DescribeActiveReceiptRuleSet" },
35
- {"service" : "ses" , "action" : "DescribeConfigurationSet" },
36
- {"service" : "ses" , "action" : "DescribeReceiptRule" },
37
- {"service" : "ses" , "action" : "DescribeReceiptRuleSet" },
38
- ]
39
- ),
28
+ assert len (expanded_actions ) == len (
29
+ [
30
+ {"service" : "ses" , "action" : "DescribeActiveReceiptRuleSet" },
31
+ {"service" : "ses" , "action" : "DescribeConfigurationSet" },
32
+ {"service" : "ses" , "action" : "DescribeReceiptRule" },
33
+ {"service" : "ses" , "action" : "DescribeReceiptRuleSet" },
34
+ ]
40
35
)
41
36
42
37
def test_expand_action_with_permission_only_action (self ):
43
38
# There are 17 privileges list as "logs.CreateLogDelivery [permission only]"
44
39
expanded_actions = expand_action ("logs:GetLogDelivery" )
45
- assert (
46
- len (expanded_actions ),
47
- len ([{"service" : "logs" , "action" : "GetLogDelivery" }]),
40
+ assert len (expanded_actions ) == len (
41
+ [{"service" : "logs" , "action" : "GetLogDelivery" }]
48
42
)
49
43
50
44
def test_exception_malformed (self ):
0 commit comments