Skip to content

Commit

Permalink
Add test_configs to tox.
Browse files Browse the repository at this point in the history
  • Loading branch information
T4rk1n committed Aug 14, 2018
1 parent b78262e commit 614693c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
20 changes: 10 additions & 10 deletions dash/_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def env_configs():
)})


def choose_config(config_name, init, env, default=None):
def get_config(config_name, init, env, default=None):
if init is not None:
return init

Expand Down Expand Up @@ -51,17 +51,17 @@ def pathname_configs(url_base_pathname=None,
'''
environ_configs = environ_configs or env_configs()

url_base_pathname = choose_config('url_base_pathname',
url_base_pathname,
environ_configs)
url_base_pathname = get_config('url_base_pathname',
url_base_pathname,
environ_configs)

routes_pathname_prefix = choose_config('routes_pathname_prefix',
routes_pathname_prefix,
environ_configs)
routes_pathname_prefix = get_config('routes_pathname_prefix',
routes_pathname_prefix,
environ_configs)

requests_pathname_prefix = choose_config('requests_pathname_prefix',
requests_pathname_prefix,
environ_configs)
requests_pathname_prefix = get_config('requests_pathname_prefix',
requests_pathname_prefix,
environ_configs)

if url_base_pathname is not None and requests_pathname_prefix is not None:
raise exceptions.InvalidConfig(
Expand Down
6 changes: 3 additions & 3 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,18 @@ def __init__(

self.url_base_pathname = url_base_pathname
self.config = _AttributeDict({
'suppress_callback_exceptions': _configs.choose_config(
'suppress_callback_exceptions': _configs.get_config(
'suppress_callback_exceptions',
suppress_callback_exceptions, env_configs, False
),
'routes_pathname_prefix': routes_pathname_prefix,
'requests_pathname_prefix': requests_pathname_prefix,
'include_assets_files': _configs.choose_config(
'include_assets_files': _configs.get_config(
'include_assets_files',
include_assets_files,
env_configs,
True),
'assets_external_path': _configs.choose_config(
'assets_external_path': _configs.get_config(
'assets_external_path', assets_external_path, env_configs, ''),
})

Expand Down
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ commands =
python -m unittest tests.development.test_component_loader
python -m unittest tests.test_integration
python -m unittest tests.test_resources
python -m unittest tests.test_configs

flake8 dash setup.py
pylint dash setup.py
Expand All @@ -25,5 +26,7 @@ commands =
python -m unittest tests.development.test_component_loader
python -m unittest tests.test_integration
python -m unittest tests.test_resources
python -m unittest tests.test_configs

flake8 dash setup.py
pylint dash setup.py

0 comments on commit 614693c

Please sign in to comment.