77from pytest_testconfig import config as py_config
88from ocp_resources .namespace import Namespace
99from ocp_resources .secret import Secret
10- from tests .model_registry .negative_tests .constants import CUSTOM_NEGATIVE_NS
11- from utilities .constants import DscComponents , Annotations
10+ from utilities .constants import Annotations
1211from tests .model_registry .constants import (
1312 MR_OPERATOR_NAME ,
1413 MR_INSTANCE_NAME ,
2120LOGGER = get_logger (name = __name__ )
2221
2322
24- @pytest .mark .parametrize (
25- "model_registry_namespace_for_negative_tests, updated_dsc_component_state_scope_class, expected_namespace" ,
26- [
27- pytest .param (
28- {"namespace_name" : CUSTOM_NEGATIVE_NS },
29- {
30- "component_patch" : {
31- DscComponents .MODELREGISTRY : {
32- "managementState" : DscComponents .ManagementState .MANAGED ,
33- "registriesNamespace" : py_config ["model_registry_namespace" ],
34- },
35- }
36- },
37- py_config ["model_registry_namespace" ],
38- ),
39- pytest .param (
40- {"namespace_name" : py_config ["model_registry_namespace" ]},
41- {
42- "component_patch" : {
43- DscComponents .MODELREGISTRY : {
44- "managementState" : DscComponents .ManagementState .MANAGED ,
45- "registriesNamespace" : CUSTOM_NEGATIVE_NS ,
46- },
47- },
48- },
49- CUSTOM_NEGATIVE_NS ,
50- ),
51- ],
52- indirect = ["model_registry_namespace_for_negative_tests" , "updated_dsc_component_state_scope_class" ],
53- )
5423@pytest .mark .usefixtures (
5524 "model_registry_namespace_for_negative_tests" ,
5625 "updated_dsc_component_state_scope_class" ,
5726 "model_registry_db_secret_negative_test" ,
5827 "model_registry_db_deployment_negative_test" ,
5928)
29+ @pytest .mark .custom_namespace
6030class TestModelRegistryCreationNegative :
6131 def test_registering_model_negative (
6232 self : Self ,
@@ -65,7 +35,6 @@ def test_registering_model_negative(
6535 updated_dsc_component_state_scope_class : DataScienceCluster ,
6636 model_registry_db_secret_negative_test : Secret ,
6737 model_registry_db_deployment_negative_test : Deployment ,
68- expected_namespace : str ,
6938 ):
7039 my_sql_dict : dict [str , str ] = {
7140 "host" : f"{ model_registry_db_deployment_negative_test .name } ."
@@ -78,7 +47,7 @@ def test_registering_model_negative(
7847 }
7948 with pytest .raises (
8049 ForbiddenError , # UnprocessibleEntityError
81- match = f"namespace must be { expected_namespace } " ,
50+ match = f"namespace must be { py_config [ 'model_registry_namespace' ] } " ,
8251 ):
8352 with ModelRegistry (
8453 name = MR_INSTANCE_NAME ,
0 commit comments