Fixes for IAM Groups
This commit is contained in:
parent
2bb3d07e11
commit
8ae1a2b357
3 changed files with 34 additions and 2 deletions
|
|
@ -1,4 +1,7 @@
|
|||
from __future__ import unicode_literals
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
import boto
|
||||
import boto3
|
||||
import sure # noqa
|
||||
|
|
@ -25,6 +28,25 @@ def test_get_group():
|
|||
conn.get_group('not-group')
|
||||
|
||||
|
||||
@mock_iam()
|
||||
def test_get_group_current():
|
||||
conn = boto3.client('iam', region_name='us-east-1')
|
||||
conn.create_group(GroupName='my-group')
|
||||
result = conn.get_group(GroupName='my-group')
|
||||
|
||||
assert result['Group']['Path'] == '/'
|
||||
assert result['Group']['GroupName'] == 'my-group'
|
||||
assert isinstance(result['Group']['CreateDate'], datetime)
|
||||
assert result['Group']['GroupId']
|
||||
assert result['Group']['Arn'] == 'arn:aws:iam::123456789012:group/my-group'
|
||||
assert not result['Users']
|
||||
|
||||
# Make a group with a different path:
|
||||
other_group = conn.create_group(GroupName='my-other-group', Path='some/location')
|
||||
assert other_group['Group']['Path'] == 'some/location'
|
||||
assert other_group['Group']['Arn'] == 'arn:aws:iam::123456789012:group/some/location/my-other-group'
|
||||
|
||||
|
||||
@mock_iam_deprecated()
|
||||
def test_get_all_groups():
|
||||
conn = boto.connect_iam()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue