-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
36 lines (30 loc) · 945 Bytes
/
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
# Done once for the whole docs
import requests, json
api_root = 'http://localhost:5555/api'
task_api = '{}/task'.format(api_root)
args = {'args': [1, 2]}
url = '{}/async-apply/deepeye.tasks.detect'.format(task_api)
print(url)
resp = requests.post(url, data=json.dumps(args))
reply = resp.json()
print reply
url = '{}/queues/length'.format(api_root)
print(url)
resp = requests.get(url)
print 'Queues length is {}'.format(resp.json())
## Get list
url = '{}/tasks'.format(api_root)
print(url)
payload = {'state': 'STARTED','taskname':'deepeye.tasks.detect'}
resp = requests.get(url,params=payload)
print 'task running is {}'.format(resp.json())
print 'Test block call'
url = '{}/apply/deepeye.tasks.detect'.format(task_api)
print(url)
resp = requests.post(url, data=json.dumps(args))
reply = resp.json()
print reply
url = '{}/queues/length'.format(api_root)
print(url)
resp = requests.get(url)
print 'Queues length is {}'.format(resp.json())