1010CONFIG_FILES = {"valid" : "tests/fixtures/configuration.yaml" ,
1111 "invalid" : "tests/fixtures/configuration_invalid.yaml" ,
1212 "client_params" : "tests/fixtures/configuration_conn_params.yaml" }
13- VALIDATION_FILES = {"valid" : "tests/fixtures/validation.yaml" }
1413
15-
16- def setup_config_object (config_file , validation_file ) -> Config :
17- """Creates a Config object using the provided config and validation files"""
14+ def setup_config_object (config_file ) -> Config :
15+ """Creates a Config object using the provided config files"""
1816 with mock .patch .dict (
1917 os .environ , {
2018 "CONFIG_FILE_PATH" : config_file ,
21- "VALIDATION_FILE_PATH" : validation_file
2219 }):
2320 return Config ()
2421
@@ -30,9 +27,9 @@ def setUp(self):
3027 """Set up dummy configs for us."""
3128 self .maxDiff = None
3229 self .config = setup_config_object (
33- CONFIG_FILES ["valid" ], VALIDATION_FILES [ "valid" ] )
30+ CONFIG_FILES ["valid" ])
3431 self .client_params_config = setup_config_object (
35- CONFIG_FILES ["client_params" ], VALIDATION_FILES [ "valid" ] )
32+ CONFIG_FILES ["client_params" ])
3633
3734 def test_invalid_get_property (self ):
3835 """Tests getting invalid properties returns None type"""
@@ -113,15 +110,15 @@ def test_load_and_validate_schema_exception_exit(self):
113110 """Tests that the program exits when loading a configuration file with a schema exception"""
114111 with self .assertRaises (SystemExit ) as cm :
115112 setup_config_object (
116- CONFIG_FILES ["invalid" ], VALIDATION_FILES [ "valid" ] )
113+ CONFIG_FILES ["invalid" ])
117114 self .assertEqual (1 , cm .exception .code )
118115
119116 def test_load_and_validate_schema_exception_error_log (self ):
120117 """Tests that an error is logged when loading a config file with a schema exception"""
121118 try :
122119 with capture_logs () as captured :
123120 setup_config_object (
124- CONFIG_FILES ["invalid" ], VALIDATION_FILES [ "valid" ] )
121+ CONFIG_FILES ["invalid" ])
125122 except SystemExit :
126123 # Catch and pass on expected SystemExit so tests keep running
127124 pass
@@ -132,7 +129,7 @@ def test_load_and_validate_no_error_log(self):
132129 try :
133130 with capture_logs () as captured :
134131 setup_config_object (
135- CONFIG_FILES ["valid" ], VALIDATION_FILES [ "valid" ] )
132+ CONFIG_FILES ["valid" ])
136133 except SystemExit :
137134 # Catch and pass on expected SystemExit so tests keep running
138135 pass
0 commit comments