-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* readme: document meta tests (for param fetching) file layout * make: Add metatest target * make: Add metatest against to doctest-coverage target * make: rename doctest-coverage to the more accurate coverage * Add some example_cache files * Add example meta test * fix flake8 errors in iam resource tests * test iam_inline_policies
- Loading branch information
Showing
8 changed files
with
94 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ install: | |
- make install | ||
|
||
script: | ||
- make doctest-coverage flake8 | ||
- make coverage flake8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
|
||
from aws.iam.resources import ( | ||
iam_users, | ||
iam_inline_policies, | ||
) | ||
|
||
|
||
def test_iam_users(): | ||
assert iam_users() == [ | ||
{ | ||
'Arn': 'arn:aws:iam::123456789012:user/hobbes', | ||
'CreateDate': '1985-11-18T00:01:10+00:00', | ||
'PasswordLastUsed': '2018-01-09T20:43:00+00:00', | ||
'Path': '/', | ||
'UserId': 'H0BBIHMA0CZ0R0K0MN00C', | ||
'UserName': 'tigerone', | ||
'__pytest_meta': {'profile': 'example-account', 'region': 'us-east-1'}}, | ||
{ | ||
'Arn': 'arn:aws:iam::123456789012:user/calvin', | ||
'CreateDate': '1985-11-18T00:01:10+00:00', | ||
'PasswordLastUsed': '2008-01-09T20:43:00+00:00', | ||
'Path': '/', | ||
'UserId': 'CALCIHMA0CZ0R0K0MN00C', | ||
'UserName': 'spacemanspiff', | ||
'__pytest_meta': {'profile': 'example-account', 'region': 'us-east-1'}}] | ||
|
||
|
||
def test_iam_inline_policies_for_user_without_policies(): | ||
# extracts empty 'PolicyNames' | ||
assert iam_inline_policies(username='tigerone') == [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
7 changes: 7 additions & 0 deletions
7
.../pytest_aws:example-account:us-east-1:iam:list_user_policies::UserName=spacemanspiff.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"PolicyNames": [], | ||
"__pytest_meta": { | ||
"profile": "example-account", | ||
"region": "us-east-1" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
...che/v/pytest_aws:example-account:us-east-1:iam:list_user_policies::UserName=tigerone.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"PolicyNames": [], | ||
"__pytest_meta": { | ||
"profile": "example-account", | ||
"region": "us-east-1" | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
example_cache/v/pytest_aws:example-account:us-east-1:iam:list_users::.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"Users": [ | ||
{ | ||
"Arn": "arn:aws:iam::123456789012:user/hobbes", | ||
"CreateDate": "1985-11-18T00:01:10+00:00", | ||
"PasswordLastUsed": "2018-01-09T20:43:00+00:00", | ||
"Path": "/", | ||
"UserId": "H0BBIHMA0CZ0R0K0MN00C", | ||
"UserName": "tigerone" | ||
}, | ||
{ | ||
"Arn": "arn:aws:iam::123456789012:user/calvin", | ||
"CreateDate": "1985-11-18T00:01:10+00:00", | ||
"PasswordLastUsed": "2008-01-09T20:43:00+00:00", | ||
"Path": "/", | ||
"UserId": "CALCIHMA0CZ0R0K0MN00C", | ||
"UserName": "spacemanspiff" | ||
} | ||
], | ||
"__pytest_meta": { | ||
"profile": "example-account", | ||
"region": "us-east-1" | ||
} | ||
} |