diff --git a/test/workflows/vrf/test_create_vrf.py b/test/workflows/vrf/test_create_vrf.py index 6ba190cb02ce5fa296e19f3c421b7025ea587d85..f2e082e8304e6ad79352b67b430939c866a25bf5 100644 --- a/test/workflows/vrf/test_create_vrf.py +++ b/test/workflows/vrf/test_create_vrf.py @@ -1,5 +1,6 @@ import pytest from orchestrator.types import SubscriptionLifecycle +from pydantic_forms.exceptions import FormValidationError from gso.products import ProductName from gso.products.product_types.vrf import VRF @@ -40,3 +41,15 @@ def test_create_vrf_success( assert subscription.vrf.route_target == vrf_input[1]["route_target"] assert subscription.vrf.vrf_as_number == vrf_input[1]["vrf_as_number"] assert subscription.description == f"VRF {vrf_input[1]["vrf_name"]}" + + +@pytest.mark.workflow() +def test_create_vrf_with_duplicate_vrf_name( + vrf_input, + faker, + vrf_subscription_factory, + data_config_filename, +): + vrf_subscription_factory(vrf_name=vrf_input[1]["vrf_name"]) + with pytest.raises(FormValidationError, match="VRF name must be unique."): + run_workflow("create_vrf", vrf_input)