Fix merge conflicts. Add basic cloudformation support. Closes #111.
This commit is contained in:
parent
069c48b43a
commit
ef876dd27e
28 changed files with 2473 additions and 11 deletions
27
tests/test_iam/test_iam.py
Normal file
27
tests/test_iam/test_iam.py
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import boto
|
||||
|
||||
import sure # noqa
|
||||
|
||||
from moto import mock_iam
|
||||
|
||||
|
||||
@mock_iam()
|
||||
def test_create_role_and_instance_profile():
|
||||
conn = boto.connect_iam()
|
||||
conn.create_instance_profile("my-profile", path="my-path")
|
||||
conn.create_role("my-role", assume_role_policy_document="some policy", path="my-path")
|
||||
|
||||
conn.add_role_to_instance_profile("my-profile", "my-role")
|
||||
|
||||
role = conn.get_role("my-role")
|
||||
role.path.should.equal("my-path")
|
||||
role.assume_role_policy_document.should.equal("some policy")
|
||||
|
||||
profile = conn.get_instance_profile("my-profile")
|
||||
profile.path.should.equal("my-path")
|
||||
role_from_profile = profile.roles.values()[0]
|
||||
role_from_profile['role_id'].should.equal(role.role_id)
|
||||
role_from_profile['role_name'].should.equal("my-role")
|
||||
|
||||
conn.list_roles().roles[0].role_name.should.equal('my-role')
|
||||
conn.list_instance_profiles().instance_profiles[0].instance_profile_name.should.equal("my-profile")
|
||||
Loading…
Add table
Add a link
Reference in a new issue