Skip to content
Snippets Groups Projects

Feature/nat 328 site names should be validated

Merged Hakan Calim requested to merge feature/NAT-328-Site-names-should-be-validated into develop
1 file
+ 6
1
Compare changes
  • Side-by-side
  • Inline
  • 99fcc99b
    NAT-328: adjusted test for site name validation · 99fcc99b
    Hakan Calim authored
@@ -9,6 +9,7 @@ from gso.products.product_blocks.iptrunk import IptrunkType, PhyPortCapacity
@@ -9,6 +9,7 @@ from gso.products.product_blocks.iptrunk import IptrunkType, PhyPortCapacity
from gso.products.product_blocks.router import RouterRole, RouterVendor
from gso.products.product_blocks.router import RouterRole, RouterVendor
from gso.products.product_blocks.site import SiteTier
from gso.products.product_blocks.site import SiteTier
from gso.utils.helpers import iso_from_ipv4
from gso.utils.helpers import iso_from_ipv4
 
from gso.api.v1.imports import SiteImportModel
SITE_IMPORT_ENDPOINT = "/api/v1/imports/sites"
SITE_IMPORT_ENDPOINT = "/api/v1/imports/sites"
ROUTER_IMPORT_ENDPOINT = "/api/v1/imports/routers"
ROUTER_IMPORT_ENDPOINT = "/api/v1/imports/routers"
@@ -82,7 +83,7 @@ def test_import_iptrunk_successful_with_mocked_process(mock_start_process, test_
@@ -82,7 +83,7 @@ def test_import_iptrunk_successful_with_mocked_process(mock_start_process, test_
@pytest.fixture
@pytest.fixture
def site_data(faker):
def site_data(faker):
return {
return {
"site_name": faker.domain_word(),
"site_name": faker.site_name(),
"site_city": faker.city(),
"site_city": faker.city(),
"site_country": faker.country(),
"site_country": faker.country(),
"site_country_code": faker.country_code(),
"site_country_code": faker.country_code(),
@@ -294,3 +295,7 @@ def test_import_iptrunk_fails_on_side_a_and_b_members_mismatch(
@@ -294,3 +295,7 @@ def test_import_iptrunk_fails_on_side_a_and_b_members_mismatch(
assert response.json() == {
assert response.json() == {
"detail": [{"loc": ["body", "__root__"], "msg": "Mismatch between Side A and B members", "type": "value_error"}]
"detail": [{"loc": ["body", "__root__"], "msg": "Mismatch between Side A and B members", "type": "value_error"}]
}
}
 
 
def test_site_name_is_valid():
 
site_model = SiteImportModel(site_name="123456")
 
assert site_model is not None
Loading