Created
November 18, 2020 08:37
-
-
Save UtsavChokshiCNU/974d89caefac9de9e602bbaf4260c420 to your computer and use it in GitHub Desktop.
Moto Example
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
# pip install moto boto3 | |
import boto3 | |
from moto import mock_iam | |
@mock_iam | |
def test_create_user(): | |
iam_client = boto3.client('iam', region_name='us-east-1') | |
library_name = 'xyz' | |
response1 = iam_client.create_user( | |
UserName=library_name, | |
Tags=[{ | |
'Key': 'project', | |
'Value': 'devflows' | |
}, | |
{ | |
'Key': 'type', | |
'Value': 'library' | |
}] | |
) | |
response2 = iam_client.get_user(UserName=library_name) | |
assert response1['User']['UserId'], response2['User']['UserId'] | |
test_create_user() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment