aboutsummaryrefslogtreecommitdiffstats
path: root/python_moondb/tests/unit_python/test_pdp.py
diff options
context:
space:
mode:
authorReemMahmoud <rfawzy.ext@orange.com>2018-05-02 14:38:52 +0200
committerReemMahmoud <rfawzy.ext@orange.com>2018-05-02 14:38:52 +0200
commitf1d3e269b87bdbfa10997606c04916bc3f36edfb (patch)
tree7db1ad9b8a5ecf777ea42cf2ef957c8ad465d178 /python_moondb/tests/unit_python/test_pdp.py
parent467351eaa204676d700f73cca6f359dd1723565c (diff)
Add unique names test cases
Change-Id: I3f314ec3b3e88839c77a93ea016c10c0a31d10b1
Diffstat (limited to 'python_moondb/tests/unit_python/test_pdp.py')
-rwxr-xr-xpython_moondb/tests/unit_python/test_pdp.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/python_moondb/tests/unit_python/test_pdp.py b/python_moondb/tests/unit_python/test_pdp.py
index 5134c0fb..942d98a3 100755
--- a/python_moondb/tests/unit_python/test_pdp.py
+++ b/python_moondb/tests/unit_python/test_pdp.py
@@ -93,6 +93,19 @@ def test_add_pdp_twice_with_same_id(db):
assert str(exception_info.value) == '409: Pdp Error'
+def test_add_pdp_twice_with_same_name(db):
+ value = {
+ "name": "test_pdp",
+ "security_pipeline": ["policy_id_1", "policy_id_2"],
+ "keystone_project_id": "keystone_project_id1",
+ "description": "...",
+ }
+ add_pdp(value=value)
+ with pytest.raises(Exception) as exception_info:
+ add_pdp(value=value)
+ assert str(exception_info.value) == '409: Pdp Error'
+
+
def test_get_pdp(db):
pdp_id = "pdp_id1"
value = {