⚗️ fix tests

This commit is contained in:
Ondrej Samohel 2025-11-26 15:17:19 +01:00
parent b967f8f818
commit 1cddb86918
No known key found for this signature in database
GPG key ID: 02376E18990A97C6

View file

@ -20,7 +20,6 @@ class TestGetProductNameTemplate:
"is_product_base_type_supported") "is_product_base_type_supported")
def test_matching_profile_with_replacements( def test_matching_profile_with_replacements(
self, self,
mock_is_supported,
mock_filter_profiles, mock_filter_profiles,
mock_get_settings, mock_get_settings,
): ):
@ -33,7 +32,6 @@ class TestGetProductNameTemplate:
"template": ("{task}-{Task}-{TASK}-{family}-{Family}" "template": ("{task}-{Task}-{TASK}-{family}-{Family}"
"-{FAMILY}-{asset}-{Asset}-{ASSET}") "-{FAMILY}-{asset}-{Asset}-{ASSET}")
} }
mock_is_supported.return_value = False
result = get_product_name_template( result = get_product_name_template(
project_name="proj", project_name="proj",
@ -54,7 +52,6 @@ class TestGetProductNameTemplate:
"is_product_base_type_supported") "is_product_base_type_supported")
def test_no_matching_profile_uses_default( def test_no_matching_profile_uses_default(
self, self,
mock_is_supported,
mock_filter_profiles, mock_filter_profiles,
mock_get_settings, mock_get_settings,
): ):
@ -62,7 +59,6 @@ class TestGetProductNameTemplate:
"core": {"tools": {"creator": {"product_name_profiles": []}}} "core": {"tools": {"creator": {"product_name_profiles": []}}}
} }
mock_filter_profiles.return_value = None mock_filter_profiles.return_value = None
mock_is_supported.return_value = False
assert ( assert (
get_product_name_template( get_product_name_template(
@ -81,7 +77,6 @@ class TestGetProductNameTemplate:
"is_product_base_type_supported") "is_product_base_type_supported")
def test_custom_default_template_used( def test_custom_default_template_used(
self, self,
mock_is_supported,
mock_filter_profiles, mock_filter_profiles,
mock_get_settings, mock_get_settings,
): ):
@ -89,7 +84,6 @@ class TestGetProductNameTemplate:
"core": {"tools": {"creator": {"product_name_profiles": []}}} "core": {"tools": {"creator": {"product_name_profiles": []}}}
} }
mock_filter_profiles.return_value = None mock_filter_profiles.return_value = None
mock_is_supported.return_value = False
custom_default = "{variant}_{family}" custom_default = "{variant}_{family}"
assert ( assert (
@ -111,7 +105,6 @@ class TestGetProductNameTemplate:
"is_product_base_type_supported") "is_product_base_type_supported")
def test_product_base_type_warns_when_supported_and_missing( def test_product_base_type_warns_when_supported_and_missing(
self, self,
mock_is_supported,
mock_filter_profiles, mock_filter_profiles,
mock_get_settings, mock_get_settings,
mock_warn, mock_warn,
@ -120,7 +113,6 @@ class TestGetProductNameTemplate:
"core": {"tools": {"creator": {"product_name_profiles": []}}} "core": {"tools": {"creator": {"product_name_profiles": []}}}
} }
mock_filter_profiles.return_value = None mock_filter_profiles.return_value = None
mock_is_supported.return_value = True
get_product_name_template( get_product_name_template(
project_name="proj", project_name="proj",
@ -137,7 +129,6 @@ class TestGetProductNameTemplate:
"is_product_base_type_supported") "is_product_base_type_supported")
def test_product_base_type_added_to_filtering_when_provided( def test_product_base_type_added_to_filtering_when_provided(
self, self,
mock_is_supported,
mock_filter_profiles, mock_filter_profiles,
mock_get_settings, mock_get_settings,
): ):
@ -145,7 +136,6 @@ class TestGetProductNameTemplate:
"core": {"tools": {"creator": {"product_name_profiles": []}}} "core": {"tools": {"creator": {"product_name_profiles": []}}}
} }
mock_filter_profiles.return_value = None mock_filter_profiles.return_value = None
mock_is_supported.return_value = True
get_product_name_template( get_product_name_template(
project_name="proj", project_name="proj",
@ -308,8 +298,6 @@ class TestGetProductName:
) )
@patch("ayon_core.pipeline.create.product_name.warn") @patch("ayon_core.pipeline.create.product_name.warn")
@patch("ayon_core.pipeline.create.product_name."
"is_product_base_type_supported")
@patch("ayon_core.pipeline.create.product_name.get_product_name_template") @patch("ayon_core.pipeline.create.product_name.get_product_name_template")
@patch("ayon_core.pipeline.create.product_name." @patch("ayon_core.pipeline.create.product_name."
"StringTemplate.format_strict_template") "StringTemplate.format_strict_template")
@ -319,11 +307,10 @@ class TestGetProductName:
mock_prepare, mock_prepare,
mock_format, mock_format,
mock_get_tmpl, mock_get_tmpl,
mock_is_supported,
mock_warn, mock_warn,
): ):
mock_get_tmpl.return_value = "{product[basetype]}_{variant}" mock_get_tmpl.return_value = "{product[basetype]}_{variant}"
mock_is_supported.return_value = True
mock_prepare.return_value = { mock_prepare.return_value = {
"product": {"type": "model"}, "product": {"type": "model"},
"variant": "Main", "variant": "Main",