This repository has been archived by the owner on Jul 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
62 lines (57 loc) · 1.42 KB
/
test.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
from datetime import datetime
from models import User, Task
from report import format_report
USER_JSON = {
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Sincere@april.biz",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
"zipcode": "92998-3874",
"geo": {
"lat": "-37.3159",
"lng": "81.1496"
}
},
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org",
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net",
"bs": "harness real-time e-markets"
}
}
TASKS_JSON = [
{
"userId": 1,
"id": 1,
"title": "delectus aut autem",
"completed": False
},
{
"userId": 1,
"id": 2,
"title": "quis ut nam facilis et officia quigre "
"fretgrebergregkrenginejignejgnrjegnjrengjrengjirengje",
"completed": False
},
{
"userId": 1,
"id": 3,
"title": "fugiat veniam minus",
"completed": False
},
{
"userId": 1,
"id": 4,
"title": "et porro tempora",
"completed": True
},
]
if __name__ == '__main__':
user = User.from_dict(USER_JSON)
tasks = [Task.from_dict(task_json) for task_json in TASKS_JSON]
print(format_report(user, tasks, datetime.now()))