Skip to content
Snippets Groups Projects
Commit 8f903f41 authored by Hakan Calim's avatar Hakan Calim Committed by Neda Moeini
Browse files

NAT-328: adjusted test for site name validation

parent 9251b4c9
No related branches found
No related tags found
1 merge request!97Feature/nat 328 site names should be validated
......@@ -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.site import SiteTier
from gso.utils.helpers import iso_from_ipv4
from gso.api.v1.imports import SiteImportModel
SITE_IMPORT_ENDPOINT = "/api/v1/imports/sites"
ROUTER_IMPORT_ENDPOINT = "/api/v1/imports/routers"
......@@ -82,7 +83,7 @@ def test_import_iptrunk_successful_with_mocked_process(mock_start_process, test_
@pytest.fixture
def site_data(faker):
return {
"site_name": faker.domain_word(),
"site_name": faker.site_name(),
"site_city": faker.city(),
"site_country": faker.country(),
"site_country_code": faker.country_code(),
......@@ -294,3 +295,7 @@ def test_import_iptrunk_fails_on_side_a_and_b_members_mismatch(
assert response.json() == {
"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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment