From b927848982548031566f6fcd449e8c5bb46989f4 Mon Sep 17 00:00:00 2001 From: Daisie Huang Date: Fri, 20 Sep 2024 18:21:10 -0700 Subject: [PATCH] Update test_opa_permissions.py --- tests/test_opa_permissions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_opa_permissions.py b/tests/test_opa_permissions.py index a340826..0fe5446 100644 --- a/tests/test_opa_permissions.py +++ b/tests/test_opa_permissions.py @@ -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) @@ -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: