Skip to content

Commit 694fdaa

Browse files
committed
fixes mocks
1 parent 4396d15 commit 694fdaa

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

services/web/server/tests/unit/isolated/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def mocked_login_required(mocker: MockerFixture):
251251
)
252252

253253
mocker.patch(
254-
"simcore_service_webserver.login.decorators.get_product_name",
254+
"simcore_service_webserver.login.decorators.products_web.get_product_name",
255255
spec=True,
256256
return_value="osparc",
257257
)

services/web/server/tests/unit/isolated/test_products_model.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,13 @@ def test_product_examples(
3434

3535
def test_product_to_static():
3636

37-
product = Product.model_validate(
38-
Product.model_config["json_schema_extra"]["examples"][0]
39-
)
37+
product = Product.model_validate(Product.model_json_schema()["examples"][0])
4038
assert product.to_statics() == {
4139
"displayName": "o²S²PARC",
4240
"supportEmail": "[email protected]",
4341
}
4442

45-
product = Product.model_validate(
46-
Product.model_config["json_schema_extra"]["examples"][2]
47-
)
43+
product = Product.model_validate(Product.model_json_schema()["examples"][2])
4844

4945
assert product.to_statics() == {
5046
"displayName": "o²S²PARC FOO",
@@ -82,7 +78,7 @@ def test_product_to_static():
8278

8379

8480
def test_product_host_regex_with_spaces():
85-
data = Product.model_config["json_schema_extra"]["examples"][2]
81+
data = Product.model_json_schema()["examples"][2]
8682

8783
# with leading and trailing spaces and uppercase (tests anystr_strip_whitespace )
8884
data["support_email"] = " [email protected] "

services/web/server/tests/unit/isolated/test_rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async def test_frontend_config(
5959
assert client.app
6060
# avoids having to start database etc...
6161
mocker.patch(
62-
"simcore_service_webserver.rest._handlers.get_product_name",
62+
"simcore_service_webserver.rest._handlers.products_web.get_product_name",
6363
spec=True,
6464
return_value="osparc",
6565
)

0 commit comments

Comments
 (0)