Skip to content

Commit

Permalink
fix tests to support python2
Browse files Browse the repository at this point in the history
  • Loading branch information
eladperets authored and pilor committed Jan 22, 2020
1 parent 0870b44 commit 5ded63c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:05 GMT
- Sat, 11 Jan 2020 00:10:28 GMT
expires:
- '-1'
pragma:
Expand Down Expand Up @@ -681,7 +681,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:06 GMT
- Sat, 11 Jan 2020 00:10:29 GMT
expires:
- '-1'
pragma:
Expand All @@ -697,7 +697,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '199'
- '198'
status:
code: 200
message: OK
Expand Down Expand Up @@ -1082,7 +1082,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:06 GMT
- Sat, 11 Jan 2020 00:10:29 GMT
expires:
- '-1'
pragma:
Expand All @@ -1098,7 +1098,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '198'
- '197'
status:
code: 200
message: OK
Expand Down Expand Up @@ -1423,7 +1423,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:06 GMT
- Sat, 11 Jan 2020 00:10:29 GMT
expires:
- '-1'
pragma:
Expand All @@ -1439,7 +1439,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '197'
- '196'
status:
code: 200
message: OK
Expand Down Expand Up @@ -1731,7 +1731,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:07 GMT
- Sat, 11 Jan 2020 00:10:30 GMT
expires:
- '-1'
pragma:
Expand All @@ -1747,7 +1747,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '196'
- '195'
status:
code: 200
message: OK
Expand Down Expand Up @@ -2055,7 +2055,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:07 GMT
- Sat, 11 Jan 2020 00:10:30 GMT
expires:
- '-1'
pragma:
Expand All @@ -2071,7 +2071,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '195'
- '194'
status:
code: 200
message: OK
Expand Down Expand Up @@ -2413,7 +2413,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:07 GMT
- Sat, 11 Jan 2020 00:10:30 GMT
expires:
- '-1'
pragma:
Expand All @@ -2429,7 +2429,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '194'
- '193'
status:
code: 200
message: OK
Expand Down Expand Up @@ -2686,7 +2686,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:07 GMT
- Sat, 11 Jan 2020 00:10:31 GMT
expires:
- '-1'
pragma:
Expand All @@ -2702,7 +2702,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '193'
- '192'
status:
code: 200
message: OK
Expand Down Expand Up @@ -2932,7 +2932,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:08 GMT
- Sat, 11 Jan 2020 00:10:31 GMT
expires:
- '-1'
pragma:
Expand All @@ -2948,7 +2948,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '192'
- '191'
status:
code: 200
message: OK
Expand Down Expand Up @@ -3172,7 +3172,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:08 GMT
- Sat, 11 Jan 2020 00:10:31 GMT
expires:
- '-1'
pragma:
Expand All @@ -3188,7 +3188,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '191'
- '190'
status:
code: 200
message: OK
Expand Down Expand Up @@ -3410,7 +3410,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:08 GMT
- Sat, 11 Jan 2020 00:10:31 GMT
expires:
- '-1'
pragma:
Expand All @@ -3426,7 +3426,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '190'
- '189'
status:
code: 200
message: OK
Expand Down Expand Up @@ -3558,7 +3558,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:08 GMT
- Sat, 11 Jan 2020 00:10:32 GMT
expires:
- '-1'
pragma:
Expand All @@ -3574,7 +3574,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '189'
- '188'
status:
code: 200
message: OK
Expand Down Expand Up @@ -6368,7 +6368,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:10 GMT
- Sat, 11 Jan 2020 00:10:34 GMT
expires:
- '-1'
pragma:
Expand All @@ -6384,7 +6384,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '198'
- '199'
status:
code: 200
message: OK
Expand Down Expand Up @@ -6707,7 +6707,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:10 GMT
- Sat, 11 Jan 2020 00:10:34 GMT
expires:
- '-1'
pragma:
Expand All @@ -6723,7 +6723,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '197'
- '198'
status:
code: 200
message: OK
Expand Down Expand Up @@ -9517,7 +9517,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:12 GMT
- Sat, 11 Jan 2020 00:10:35 GMT
expires:
- '-1'
pragma:
Expand All @@ -9533,7 +9533,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '199'
- '197'
status:
code: 200
message: OK
Expand Down Expand Up @@ -9856,7 +9856,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:13 GMT
- Sat, 11 Jan 2020 00:10:35 GMT
expires:
- '-1'
pragma:
Expand All @@ -9872,7 +9872,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '198'
- '196'
status:
code: 200
message: OK
Expand Down Expand Up @@ -9938,7 +9938,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:13 GMT
- Sat, 11 Jan 2020 00:10:36 GMT
expires:
- '-1'
pragma:
Expand All @@ -9954,7 +9954,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '188'
- '199'
status:
code: 200
message: OK
Expand Down Expand Up @@ -10020,7 +10020,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Fri, 10 Jan 2020 00:44:14 GMT
- Sat, 11 Jan 2020 00:10:36 GMT
expires:
- '-1'
pragma:
Expand All @@ -10036,7 +10036,7 @@ interactions:
x-content-type-options:
- nosniff
x-ms-ratelimit-remaining-tenant-policy-insights-requests:
- '199'
- '187'
status:
code: 200
message: OK
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,16 +444,16 @@ def test_policy_insights_metadata(self):
# Test the --top argument
assert len(self.cmd('policy metadata list --top 0').get_output_in_json()) == 0

top_metadata_resources = self.cmd(f'policy metadata list --top {len(all_metadata_resources) + 1}').get_output_in_json()
top_metadata_resources = self.cmd('policy metadata list --top {}'.format(len(all_metadata_resources) + 1)).get_output_in_json()
assert len(top_metadata_resources) == len(all_metadata_resources)

top_metadata_resources = self.cmd(f'policy metadata list --top {len(all_metadata_resources) - 1}').get_output_in_json()
top_metadata_resources = self.cmd('policy metadata list --top {}'.format(len(all_metadata_resources) - 1)).get_output_in_json()
assert len(top_metadata_resources) == len(all_metadata_resources) - 1

# Test getting an individual resouce
resource_metadata_name = top_metadata_resources[0]['name']
metadata_resource = self.cmd(f'policy metadata show --name {resource_metadata_name}').get_output_in_json()
metadata_resource = self.cmd('policy metadata show --name {}'.format(resource_metadata_name)).get_output_in_json()
assert metadata_resource['name'] == resource_metadata_name

metadata_resource = self.cmd(f'policy metadata show -n {resource_metadata_name}').get_output_in_json()
metadata_resource = self.cmd('policy metadata show -n {}'.format(resource_metadata_name)).get_output_in_json()
assert metadata_resource['name'] == resource_metadata_name

0 comments on commit 5ded63c

Please sign in to comment.