diff options
Diffstat (limited to 'src/leap/base')
-rw-r--r-- | src/leap/base/config.py | 3 | ||||
-rw-r--r-- | src/leap/base/constants.py | 8 | ||||
-rw-r--r-- | src/leap/base/tests/test_config.py | 5 |
3 files changed, 14 insertions, 2 deletions
diff --git a/src/leap/base/config.py b/src/leap/base/config.py index 8455f9de..4d7db018 100644 --- a/src/leap/base/config.py +++ b/src/leap/base/config.py @@ -13,6 +13,7 @@ logger = logging.getLogger(name=__name__) logger.setLevel('DEBUG') from leap.base import exceptions +from leap.base import constants from leap.util.fileutil import (mkdir_p) @@ -135,7 +136,7 @@ def get_config_file(filename, folder=None): def get_default_provider_path(): default_subpath = os.path.join("providers", - "default") + constants.DEFAULT_TEST_PROVIDER) default_provider_path = get_config_file( '', folder=default_subpath) diff --git a/src/leap/base/constants.py b/src/leap/base/constants.py new file mode 100644 index 00000000..55308a31 --- /dev/null +++ b/src/leap/base/constants.py @@ -0,0 +1,8 @@ +"""constants to be used in base module""" + +# default provider placeholder +# using `example.org` we make sure that this +# is not going to be resolved during the tests phases +# (we expect testers to add it to their /etc/hosts + +DEFAULT_TEST_PROVIDER = "testprovider.example.org" diff --git a/src/leap/base/tests/test_config.py b/src/leap/base/tests/test_config.py index 0a98dbaf..67be0e54 100644 --- a/src/leap/base/tests/test_config.py +++ b/src/leap/base/tests/test_config.py @@ -8,6 +8,7 @@ import mock import requests from leap.base import config +from leap.base import constants from leap.base import exceptions from leap.util.fileutil import mkdir_p from leap.testing.basetest import BaseLeapTest @@ -215,7 +216,9 @@ class ConfigHelperFunctions(BaseLeapTest): """ self.assertEqual( config.get_default_provider_path(), - os.path.expanduser('~/.config/leap/providers/default/') + os.path.expanduser( + '~/.config/leap/providers/%s/' % + constants.DEFAULT_TEST_PROVIDER) ) # validate ip |