diff options
Diffstat (limited to 'moon_manager/tests/unit_python/api/utilities.py')
-rw-r--r-- | moon_manager/tests/unit_python/api/utilities.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/moon_manager/tests/unit_python/api/utilities.py b/moon_manager/tests/unit_python/api/utilities.py index a2b0689b..66ca30c5 100644 --- a/moon_manager/tests/unit_python/api/utilities.py +++ b/moon_manager/tests/unit_python/api/utilities.py @@ -9,4 +9,18 @@ def register_client(): import moon_manager.server server = moon_manager.server.create_server() client = server.app.test_client() - return client
\ No newline at end of file + return client + + +def get_policy_id(): + import api.test_policies as policies + client = register_client() + policy_id = '' + req, policy = policies.get_policies(client) + for id in policy['policies']: + if id: + policy_id = id + break + if not policy_id: + policies.add_policies(client, "testuser") + return policy_id |