|
6 | 6 | class ConfigTestCase(unittest.TestCase): |
7 | 7 |
|
8 | 8 | def test_config_without_file(self): |
9 | | - self.assertRaises(ConfigFileNotFoundError, Config, SIMPLE_SCHEMA_CONFIG, 'config', 'some_non_exists_file.json') |
| 9 | + self.assertRaises(ConfigFileNotFoundError, Config.get_config, SIMPLE_SCHEMA_CONFIG, 'config', 'some_non_exists_file.json') |
10 | 10 |
|
11 | 11 | def test_config_with_wrong_json_model(self): |
12 | | - self.assertRaises(ConfigFileModelError, Config, SIMPLE_SCHEMA_CONFIG, 'config', 'wrong_model.json') |
| 12 | + self.assertRaises(ConfigFileModelError, Config.get_config, SIMPLE_SCHEMA_CONFIG, 'config', 'wrong_model.json') |
13 | 13 |
|
14 | 14 | def test_config_file_with_unsupported_extension(self): |
15 | | - self.assertRaises(ConfigFileExtensionNotSupportedError, Config, SIMPLE_SCHEMA_CONFIG, 'config', 'config.bad_extension') |
| 15 | + self.assertRaises(ConfigFileExtensionNotSupportedError, Config.get_config, SIMPLE_SCHEMA_CONFIG, 'config', 'config.bad_extension') |
16 | 16 |
|
17 | 17 | def test_to_access_attr_from_config(self): |
18 | | - config = Config(SIMPLE_SCHEMA_CONFIG) |
| 18 | + config = Config.get_config(SIMPLE_SCHEMA_CONFIG) |
19 | 19 | self.assertEqual(config.core.logging.format, 'format') |
20 | 20 | self.assertEqual(config.core.logging.datefmt, 'datefmt') |
21 | 21 | self.assertEqual(config.core.obj_list[0].name, 'bruno') |
22 | 22 | self.assertEqual(config.core.obj_list[0].age, 24) |
23 | 23 |
|
24 | 24 | def test_access_fake_attr(self): |
25 | | - config = Config(SIMPLE_SCHEMA_CONFIG) |
| 25 | + config = Config.get_config(SIMPLE_SCHEMA_CONFIG) |
26 | 26 | self.assertRaises(AttributeError, lambda: config.fake_attr) |
27 | 27 |
|
28 | 28 |
|
|
0 commit comments