@@ -16,10 +16,10 @@ def test_provider_config_creation_valid():
16
16
key_config_1 = KeyConfig (key = "attr_nameA" , values = ["7" , "4" , "8" , "12" ])
17
17
key_config_2 = KeyConfig (key = "attr_nameB" , values = ["3" , "7" , "2" , "18" , "22" ])
18
18
provider_config = ProviderConfig (
19
- provider = "provider_name" , configs = [key_config_1 , key_config_2 ]
19
+ namespace = "provider_name" , configs = [key_config_1 , key_config_2 ]
20
20
)
21
21
22
- assert provider_config .provider == "provider_name"
22
+ assert provider_config .namespace == "provider_name"
23
23
assert len (provider_config .configs ) == 2
24
24
assert provider_config .configs [0 ].key == "attr_nameA"
25
25
assert provider_config .configs [1 ].key == "attr_nameB"
@@ -33,7 +33,7 @@ def test_duplicate_key_config():
33
33
with pytest .raises (
34
34
ValueError , match = "Duplicate `KeyConfig` for key='attr_nameA' found."
35
35
):
36
- ProviderConfig (provider = "provider_name" , configs = [key_config_1 , key_config_2 ])
36
+ ProviderConfig (namespace = "provider_name" , configs = [key_config_1 , key_config_2 ])
37
37
38
38
39
39
def test_empty_values_list_in_key_config ():
@@ -69,34 +69,34 @@ def test_invalid_values_type_in_key_config():
69
69
) # Expecting a list for `values`
70
70
71
71
72
- def test_provider_config_invalid_provider_type ():
73
- """Test that an invalid provider type raises a validation error."""
72
+ def test_provider_config_invalid_namespace_type ():
73
+ """Test that an invalid namespace type raises a validation error."""
74
74
with pytest .raises (TypeError ):
75
75
ProviderConfig (
76
- provider = 1 ,
76
+ namespace = 1 ,
77
77
configs = [KeyConfig (key = "attr_nameA" , values = ["7" , "4" , "8" , "12" ])],
78
78
)
79
79
80
80
81
81
def test_provider_config_invalid_configs_type ():
82
82
"""Test that an invalid configs type raises a validation error."""
83
83
with pytest .raises (TypeError ):
84
- ProviderConfig (provider = "provider_name" , configs = "not_a_list_of_key_configs" )
84
+ ProviderConfig (namespace = "provider_name" , configs = "not_a_list_of_key_configs" )
85
85
86
86
87
87
def test_provider_config_invalid_key_type_in_configs ():
88
88
"""Test that invalid `KeyConfig` inside `ProviderConfig` raises an error."""
89
89
with pytest .raises (TypeError ):
90
90
ProviderConfig (
91
- provider = "provider_name" ,
91
+ namespace = "provider_name" ,
92
92
configs = [{"key" : "attr_nameA" , "values" : ["7" , "4" , "8" , "12" ]}],
93
93
)
94
94
95
95
96
96
def test_empty_provider_config ():
97
97
"""Test creation of ProviderConfig with an empty list of KeyConfigs."""
98
98
with pytest .raises (AssertionError ):
99
- _ = ProviderConfig (provider = "provider_name" , configs = [])
99
+ _ = ProviderConfig (namespace = "provider_name" , configs = [])
100
100
101
101
102
102
def test_provider_config_invalid_key_config_type ():
@@ -105,7 +105,7 @@ def test_provider_config_invalid_key_config_type():
105
105
106
106
with pytest .raises (TypeError ):
107
107
ProviderConfig (
108
- provider = "provider_name" ,
108
+ namespace = "provider_name" ,
109
109
configs = [
110
110
KeyConfig (key = "attr_nameA" , values = ["7" , "4" , "8" , "12" ]),
111
111
SimpleNamespace (key = 1 , values = ["1" , "2" ]),
@@ -130,11 +130,11 @@ def test_provider_config_repr():
130
130
key_config_1 = KeyConfig (key = "attr_nameA" , values = ["7" , "4" , "8" , "12" ])
131
131
key_config_2 = KeyConfig (key = "attr_nameB" , values = ["3" , "7" , "2" , "18" , "22" ])
132
132
provider_config = ProviderConfig (
133
- provider = "provider_name" , configs = [key_config_1 , key_config_2 ]
133
+ namespace = "provider_name" , configs = [key_config_1 , key_config_2 ]
134
134
)
135
135
136
136
expected_repr = (
137
- "ProviderConfig(provider ='provider_name', "
137
+ "ProviderConfig(namespace ='provider_name', "
138
138
"configs=[KeyConfig(key='attr_nameA', values=['7', '4', '8', '12']), "
139
139
"KeyConfig(key='attr_nameB', values=['3', '7', '2', '18', '22'])])"
140
140
)
0 commit comments