diff options
Diffstat (limited to 'python_moondb/tests/unit_python/test_pdp.py')
-rwxr-xr-x | python_moondb/tests/unit_python/test_pdp.py | 13 |
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 = { |