aboutsummaryrefslogtreecommitdiffstats
path: root/moon_manager/tests/unit_python/api/test_policies.py
diff options
context:
space:
mode:
Diffstat (limited to 'moon_manager/tests/unit_python/api/test_policies.py')
-rw-r--r--moon_manager/tests/unit_python/api/test_policies.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/moon_manager/tests/unit_python/api/test_policies.py b/moon_manager/tests/unit_python/api/test_policies.py
index 4d4e387e..40be35e6 100644
--- a/moon_manager/tests/unit_python/api/test_policies.py
+++ b/moon_manager/tests/unit_python/api/test_policies.py
@@ -1,5 +1,11 @@
+# Copyright 2018 Open Platform for NFV Project, Inc. and its contributors
+# This software is distributed under the terms and conditions of the 'Apache-2.0'
+# license which can be found in the file 'LICENSE' in this package distribution
+# or at 'http://www.apache.org/licenses/LICENSE-2.0'.
+
import json
import api.utilities as utilities
+from uuid import uuid4
def get_policies(client):
@@ -45,13 +51,14 @@ def test_get_policies():
def test_add_policies():
client = utilities.register_client()
- req, policies = add_policies(client, "testuser")
+ policy_name = "testuser" + uuid4().hex
+ req, policies = add_policies(client, policy_name)
assert req.status_code == 200
assert isinstance(policies, dict)
value = list(policies["policies"].values())[0]
assert "policies" in policies
- assert value['name'] == "testuser"
- assert value["description"] == "description of {}".format("testuser")
+ assert value['name'] == policy_name
+ assert value["description"] == "description of {}".format(policy_name)
assert value["model_id"] == "modelId"
assert value["genre"] == "genre"