blob: a63948f8f085558772578cfd8ffdbe0686050d31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import json
def get_json(data):
return json.loads(data.decode("utf-8"))
def test_authz_true(context):
import moon_interface.server
server = moon_interface.server.main()
client = server.app.test_client()
req = client.get("/authz/{p_id}/{s_id}/{o_id}/{a_id}".format(
p_id=context["project_id"],
s_id=context["subject_name"],
o_id=context["object_name"],
a_id=context["action_name"],
))
assert req.status_code == 200
data = get_json(req.data)
assert data
assert "result" in data
assert data['result'] == True
|