-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
64 lines (50 loc) · 2.21 KB
/
Copy pathtest.py
File metadata and controls
64 lines (50 loc) · 2.21 KB
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
63
64
# -*- coding: utf-8 -*-
from requests import get, post
import time
import json
def test_login():
print get('http://localhost:5000/login/chen_xi/worksap').json()
print get('http://localhost:5000/login/cccc/worksap').json()
def test_milestone_list():
print json.dumps(get('http://localhost:5000/milestoneList').json(), indent=4)
def test_workload_list():
print json.dumps(get('http://localhost:5000/workloadList/Connector/12-VerUp').json(), indent=4)
print json.dumps(get('http://localhost:5000/workloadList/chen_xi/aaa').json(), indent=4)
def test_ticket_update():
print json.dumps(
post('http://localhost:5000/ticket/update',
json={
'team': 'Connector',
'milestone': '12-VerUp',
'ticket': {
'no': 12178,
'title': 'NNNNNNNNNNNNNNNNNNN',
'developer': 'chen_xi',
'evaluator': 'luo yi',
'developmentManDay': 9999,
'developmentProgress': 888,
'evaluationManDay': 777,
'evaluationProgress': 666,
}
}).json(),
indent=4)
time.sleep(1)
print json.dumps(get('http://localhost:5000/workloadList/Connector/12-VerUp').json(), indent=4)
def test_ticket_list_update_merge():
files = {'file': open('exportCsv.csv', 'rb')}
data = {'milestone': '12-VerUp', 'team': 'Connector', 'mode': 'merge'}
print json.dumps(post('http://localhost:5000/ticketList/update', files=files, data=data).json(), indent=4)
time.sleep(1)
print json.dumps(get('http://localhost:5000/workloadList/Connector/12-VerUp').json(), indent=4)
# def test_ticket_list_update_override():
# files = {'file': open('exportCsv.csv', 'rb')}
# data = {'milestone': '12-VerUp', 'team': 'Connector', 'mode': 'override'}
# print post('http://localhost:5000/ticketList/update', files=files, data=data).json()
# time.sleep(1)
# print get('http://localhost:5000/workloadList/Connector/12-VerUp').json()
if __name__ == '__main__':
# test_login()
# test_milestone_list()
# test_workload_list()
test_ticket_update()
# test_ticket_list_update_merge()