Skip to content

Commit

Permalink
Update test_opa_permissions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
daisieh committed Sep 21, 2024
1 parent d06476b commit b927848
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_opa_permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def evaluate_opa(user, input, key, expected_result, site_roles, users, programs)
args = [
"./opa", "eval",
"--data", "permissions_engine/authz.rego",
"--data", "permissions_engine/calculate.rego",
"--data", "permissions_engine/permissions.rego",
]
vault = setup_vault(user, site_roles, users, programs)
Expand Down Expand Up @@ -217,8 +218,8 @@ def evaluate_opa(user, input, key, expected_result, site_roles, users, programs)
print(json.dumps({"input": input}))
p = subprocess.run(args, stdout=subprocess.PIPE)
r = json.loads(p.stdout)
print(r)
result =r['result'][0]['expressions'][0]['value']
print(result)
if key in result:
assert result[key] == expected_result
else:
Expand Down

0 comments on commit b927848

Please sign in to comment.