From e738a0253e63883991d48dd0a4e5ef6ab91c0c88 Mon Sep 17 00:00:00 2001 From: anders-albert Date: Sat, 16 Nov 2024 16:22:56 +0100 Subject: [PATCH] tests: replace Wind in external id factories --- .../test_utils/tests_external_id_factories.py | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/test_unit/test_utils/tests_external_id_factories.py b/tests/test_unit/test_utils/tests_external_id_factories.py index 70fb605b4..035185a0f 100644 --- a/tests/test_unit/test_utils/tests_external_id_factories.py +++ b/tests/test_unit/test_utils/tests_external_id_factories.py @@ -3,7 +3,7 @@ from dataclasses import dataclass import pytest -from windmill.data_classes import DomainModelWrite, RotorWrite, WindmillWrite +from wind_turbine.data_classes import DomainModelWrite, RotorWrite, WindTurbineWrite from cognite.pygen.utils.external_id_factories import ( ExternalIdFactory, @@ -49,7 +49,7 @@ def test_shorten_string(input_str: str, length: int, expected: str): @pytest.mark.parametrize( "domain_cls, data, expected, short_expected", [ - (WindmillWrite, {}, "windmill", "windmil"), + (WindTurbineWrite, {}, "windturbine", "windtur"), (RotorWrite, {}, "rotor", "rotor"), (FooBarApply, {}, "foobarapply", "foobara"), ], @@ -68,7 +68,7 @@ def test_domain_name_factory(domain_cls: type, data: dict, expected: str, short_ @pytest.mark.parametrize( "domain_cls, data", [ - (WindmillWrite, {}), + (WindTurbineWrite, {}), (RotorWrite, {}), (FooBarApply, {}), ], @@ -107,8 +107,8 @@ def test_sha256_factory(data: dict, expected: str, short_expected: str): @pytest.mark.parametrize( "domain_cls, expected, expected_factory, short_expected", [ - (WindmillWrite, "1", "2", "3"), - (WindmillWrite, "4", "5", "6"), + (WindTurbineWrite, "1", "2", "3"), + (WindTurbineWrite, "4", "5", "6"), (RotorWrite, "1", "2", "3"), (FooBarApply, "1", "2", "3"), ], @@ -161,7 +161,7 @@ def test_external_id_generator_override_false(): "testfoo|c6c9d7497c9a7d180d7c8a5f88b01a5030260cc4bc833467fcc45dcfb1a4a4d1", ), ( - WindmillWrite, + WindTurbineWrite, {"name": "foo"}, True, "|", @@ -213,10 +213,10 @@ def test_create_external_id_factory_short(): prefix_ext_id_factory=ExternalIdFactory.domain_name_factory().short, suffix_ext_id_factory=ExternalIdFactory.uuid_factory().short, ) - actual_1 = factory(WindmillWrite, {"name": "foo"}) - actual_2 = factory(WindmillWrite, {}) + actual_1 = factory(WindTurbineWrite, {"name": "foo"}) + actual_2 = factory(WindTurbineWrite, {}) - expected_prefix = "windmil|" + expected_prefix = "windtur|" assert callable(factory) assert actual_1.startswith(expected_prefix) @@ -234,8 +234,8 @@ def test_create_external_id_factory_custom(): factory=lambda domain_cls, data: data.get("name", "no_name"), shorten_length=3 ), ) - actual_1 = factory(WindmillWrite, {"name": "foo"}) - actual_2 = factory(WindmillWrite, {}) + actual_1 = factory(WindTurbineWrite, {"name": "foo"}) + actual_2 = factory(WindTurbineWrite, {}) assert callable(factory) assert actual_1 == "tes|foo" @@ -252,7 +252,7 @@ def test_create_external_id_factory_custom(): "rotor:", "c6c9d7497c9a7d180d7c8a5f88b01a5030260cc4bc833467fcc45dcfb1a4a4d1", ), - (WindmillWrite, {"name": "foobar"}, True, "windmill:", "df323f4"), + (WindTurbineWrite, {"name": "foobar"}, True, "windturbine:", "df323f4"), ], ) def test_external_id_factories_to_be_deprecated( @@ -337,5 +337,5 @@ class _FooBarWrite: pass - assert domain_name(_FooBarWrite, {}) == "foobarwrite" - assert domain_name(WindmillWrite, {}) == "windmill" + assert domain_name(_FooBarWrite, {}) == "_foobarwrite" + assert domain_name(WindTurbineWrite, {}) == "windturbine"