Skip to content
Snippets Groups Projects
Commit fb77c497 authored by slobinger's avatar slobinger
Browse files

Merge branch '5-implement-getInstance' into 'master'

Resolve "getInstance implementieren"

Closes #5 and #4

See merge request !3
parents 86cfbf25 a24ef1f5
No related branches found
No related tags found
1 merge request!3Resolve "getInstance implementieren"
class ConfigProvider:
_instance = None
@classmethod
def getInstance(cls):
return ConfigProvider._instance
def __init__(self, load_function):
self._conf_dict = load_function['function'](
*load_function.get('args'), **load_function.get('kwargs'))
self._load_function = load_function
ConfigProvider._instance = self
@property
def dict(self):
......
......@@ -44,4 +44,7 @@ class TestConfigProvider(unittest.TestCase):
expected_dict, self.config.dict,
'expected_dict musst equal self.config.dict')
self.assertNotEqual(
old_dict, self.config.dict, 'old_dict musst not equal self.config.dict')
\ No newline at end of file
old_dict, self.config.dict, 'old_dict musst not equal self.config.dict')
def test_get_instance(self):
self.assertEqual(config_provider.ConfigProvider.getInstance(), self.config)
\ No newline at end of file
__version__ = '1.0.0'
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment