Skip to content

Commit d14847e

Browse files
author
BrunoSilvaAndrade
committed
Fixing tests
1 parent 0dc6500 commit d14847e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

test_configparser.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66
class ConfigTestCase(unittest.TestCase):
77

88
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')
1010

1111
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')
1313

1414
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')
1616

1717
def test_to_access_attr_from_config(self):
18-
config = Config(SIMPLE_SCHEMA_CONFIG)
18+
config = Config.get_config(SIMPLE_SCHEMA_CONFIG)
1919
self.assertEqual(config.core.logging.format, 'format')
2020
self.assertEqual(config.core.logging.datefmt, 'datefmt')
2121
self.assertEqual(config.core.obj_list[0].name, 'bruno')
2222
self.assertEqual(config.core.obj_list[0].age, 24)
2323

2424
def test_access_fake_attr(self):
25-
config = Config(SIMPLE_SCHEMA_CONFIG)
25+
config = Config.get_config(SIMPLE_SCHEMA_CONFIG)
2626
self.assertRaises(AttributeError, lambda: config.fake_attr)
2727

2828

0 commit comments

Comments
 (0)