-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_boto3auth.py
38 lines (31 loc) · 1.1 KB
/
test_boto3auth.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
"""Unit tests for boto3auth."""
import boto3auth
def test_init_class():
"""Test instantiating Boto3Auth class."""
b3a = boto3auth.Boto3Auth()
assert b3a.region == 'us-east-1'
assert b3a.account_id is False
assert b3a.role is False
assert b3a.sts is None
def test_init_class_with_region():
"""Test instantiating Boto3Auth class with a region."""
test_region = 'ca-central-1'
b3a = boto3auth.Boto3Auth(test_region)
assert b3a.region == test_region
assert b3a.account_id is False
assert b3a.role is False
assert b3a.sts is None
def test_init_class_with_account_role():
"""Test instantiating Boto3Auth class with an account/role."""
test_data = {
'region': 'us-east-1',
'account_id': '123412341234',
'role': 'my-cool-role'
}
b3a = boto3auth.Boto3Auth(test_data['region'], test_data['account_id'],
test_data['role'])
assert b3a.region == test_data['region']
assert b3a.account_id == test_data['account_id']
assert b3a.role == test_data['role']
assert b3a.sts is None