-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapimap-demo.py
executable file
·41 lines (41 loc) · 1.05 KB
/
apimap-demo.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
#!/usr/bin/python3
from aioflureedb import FlureeDomainAPI
domain_api = FlureeDomainAPI("./api_maps")
role = domain_api.get_api_by_role("demo_role")
trans1 = role.create_demo_user_role()
print(trans1())
trans2 = role.create_demo_user(full_name="John Doe", email="[email protected]", pubkey="TfB5z166pcmReVA3sfEqisjgv7pX2gefff0")
print(trans2())
trans3 = role.create_demo_user(full_name="Jane Doe", email="[email protected]", pubkey="TfB5z166pcmReVA3sfEqisjgv7pX2ge0000")
print(trans3())
query = role.get_demo_users()
print(query())
fake_response = [
[
{
"username": "John Doe",
"_id": 87960930223083,
"auth": [
{
"id": "TfB5z166pcmReVA3sfEqisjgv7pX2gefff0",
"_id": 105553116267499
}
],
"doc": "[email protected]"
}
],
[
{
"username": "Jane Doe",
"_id": 87960930223082,
"auth": [
{
"id": "TfB5z166pcmReVA3sfEqisjgv7pX2ge0000",
"_id": 105553116267498
}
],
"doc": "[email protected]"
}
]
]
print(query(fake_response))