Beispiel #1
0
    def test_get_default_value(self):
        __expected = 'val_only_default'

        consts = ConstantsManager()
        assert __expected == consts.get('val_only_default')
Beispiel #2
0
 def test_using_not_exists_os_environment_and_not_find_key(self):
     os.environ["ENV_DUMMY"] = 'dev'
     consts = ConstantsManager(constants_name='DUMMY')
     import pytest
     with pytest.raises(Exception):
         consts.get('val_only_dev')
Beispiel #3
0
    def test_change_os_environment(self):
        __expected = 'val_only_default'

        os.environ["ENV_DUMMY"] = 'dev'
        consts = ConstantsManager(constants_name='ENV_DUMMY')
        assert __expected == consts.get('val_only_default')
Beispiel #4
0
    def test_using_not_exists_os_environment(self):
        __expected = 'val_only_default'

        os.environ["ENV_DUMMY"] = 'dev'
        consts = ConstantsManager()
        assert __expected == consts.get('val_only_default')
Beispiel #5
0
    def test_get_default_value_witout_section_value(self):
        __expected = 'val_only_default'

        os.environ["ENV"] = 'dev'
        consts = ConstantsManager()
        assert __expected == consts.get('val_only_default')