-
Notifications
You must be signed in to change notification settings - Fork 0
/
quick_test.py
48 lines (40 loc) · 1.3 KB
/
quick_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
import json
import requests
print("sending before registering")
resp = requests.post(
"http://localhost:5000/client1/new_event1/send_event",
data={"event":json.dumps({"color":"blue"})},
)
print(json.dumps(resp.json(), indent=2), "\n")
print("registering events")
resp = requests.post(
"http://localhost:5000/client1/new_event1/register_event",
data={"event_schema":json.dumps(
{"type":"object", "required":["color"]})
},
)
print(json.dumps(resp.json(), indent=2), "\n")
print("registering events again")
resp = requests.post(
"http://localhost:5000/client1/new_event1/register_event",
data={"event_schema":json.dumps(
{"type":"object", "required":["color"]})
},
)
print(json.dumps(resp.json(), indent=2), "\n")
print("sending after registering")
resp = requests.post(
"http://localhost:5000/client1/new_event1/send_event",
data={"event":json.dumps({"color":"blue"})},
)
print(json.dumps(resp.json(), indent=2), "\n")
print("Get event schema")
resp = requests.get(
"http://localhost:5000/client1/new_event1/schema",
)
print(json.dumps(resp.json(), indent=2), "\n")
print("list events")
resp = requests.get(
"http://localhost:5000/client1/list_events",
)
print(json.dumps(resp.json(), indent=2), "\n")