aboutsummaryrefslogtreecommitdiffstats
path: root/python_moondb/tests/unit_python/test_pdp.py
diff options
context:
space:
mode:
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 = {