-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_daco2ego.py
executable file
·39 lines (32 loc) · 1.14 KB
/
test_daco2ego.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
39
#!/usr/bin/env python
from daco2ego import daco_users_csv_to_list, read_config
from daco_user import User
def test_read_config():
expected = {
"client": {
"base_url": "https://ego/v1/",
"daco_group": "DACO-TEST",
"cloud_group":"DACO-CLOUD-TEST"
},
"daco_v2_client": {
"ego_url": "https://ego/v2/",
"dac_api_url": "https://dac-api/v2/"
}
}
config = read_config("tests/test.conf")
assert config == expected
def file_to_dict(name):
with open("tests/" + name, "r") as f:
return daco_users_csv_to_list(f.read())
def test_users():
expected = [
User('[email protected]','DDD LLL', True, True),
User('[email protected]','Betty White',True, True),
User('[email protected]', 'Blanche Devereaux', True, True),
User('[email protected]', 'NewFirst Tester',True, True),
User('[email protected]', 'Edna Krabapple', True, True),
User('[email protected]', 'Gary Chalmers', True, True )
]
daco = file_to_dict("test_users.csv")
print(daco)
assert daco == expected