Adding new table settings to docker_settings

This commit is contained in:
Mike Terzo
2017-01-26 13:53:29 -05:00
parent ebab9ccdbc
commit 8b883b32f8
2 changed files with 17 additions and 1 deletions

View File

@@ -26,7 +26,13 @@ ENABLE_QUERY = os.getenv('ENABLE_QUERY', 'True')
LOCALISE_TIMESTAMP = bool(os.getenv('LOCALISE_TIMESTAMP', LOCALISE_TIMESTAMP = bool(os.getenv('LOCALISE_TIMESTAMP',
'True').upper() == 'TRUE') 'True').upper() == 'TRUE')
LOGLEVEL = os.getenv('LOGLEVEL', 'info') LOGLEVEL = os.getenv('LOGLEVEL', 'info')
REPORTS_COUNT = int(os.getenv('REPORTS_COUNT', '10')) NORMAL_TABLE_COUNT = int(os.getenv('REPORTS_COUNT', '100'))
LITTLE_TABLE_COUNT = int(os.getenv('LITTLE_TABLE_COUNT', '10'))
TABLE_COUNT_DEF = "10,20,50,100,500"
TABLE_COUNT_SELECTOR = [int(x) for x in os.getenv('TABLE_COUNT_SELECTOR',
TABLE_COUNT_DEF).split(',')]
OFFLINE_MODE = bool(os.getenv('OFFLINE_MODE', 'False').upper() == 'TRUE') OFFLINE_MODE = bool(os.getenv('OFFLINE_MODE', 'False').upper() == 'TRUE')
ENABLE_CATALOG = bool(os.getenv('ENABLE_CATALOG', 'False').upper() == 'TRUE') ENABLE_CATALOG = bool(os.getenv('ENABLE_CATALOG', 'False').upper() == 'TRUE')
OVERVIEW_FILTER = os.getenv('OVERVIEW_FILTER', None) OVERVIEW_FILTER = os.getenv('OVERVIEW_FILTER', None)

View File

@@ -106,3 +106,13 @@ def test_bad_log_value(cleanUpEnv):
reload(docker_settings) reload(docker_settings)
with pytest.raises(ValueError) as error: with pytest.raises(ValueError) as error:
reload(app) reload(app)
def test_default_table_selctor(cleanUpEnv):
assert [10, 20, 50, 100, 500] == docker_settings.TABLE_COUNT_SELECTOR
def test_env_table_selector(cleanUpEnv):
os.environ['TABLE_COUNT_SELECTOR'] = '5,15,25'
reload(docker_settings)
assert [5, 15, 25] == docker_settings.TABLE_COUNT_SELECTOR