diff --git a/puppetboard/docker_settings.py b/puppetboard/docker_settings.py index 9ea14c3..fa0055c 100644 --- a/puppetboard/docker_settings.py +++ b/puppetboard/docker_settings.py @@ -26,7 +26,13 @@ ENABLE_QUERY = os.getenv('ENABLE_QUERY', 'True') LOCALISE_TIMESTAMP = bool(os.getenv('LOCALISE_TIMESTAMP', 'True').upper() == 'TRUE') 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') ENABLE_CATALOG = bool(os.getenv('ENABLE_CATALOG', 'False').upper() == 'TRUE') OVERVIEW_FILTER = os.getenv('OVERVIEW_FILTER', None) diff --git a/test/test_docker_settings.py b/test/test_docker_settings.py index a172ae9..4b36a6d 100644 --- a/test/test_docker_settings.py +++ b/test/test_docker_settings.py @@ -106,3 +106,13 @@ def test_bad_log_value(cleanUpEnv): reload(docker_settings) with pytest.raises(ValueError) as error: 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