Skip to content

Commit

Permalink
add missing test for app name setting
Browse files Browse the repository at this point in the history
  • Loading branch information
abatisse committed Jun 16, 2019
1 parent e579533 commit f4daea3
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/unit/test_configs.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import os
import unittest
import pytest
from flask import Flask
# noinspection PyProtectedMember
from dash._configs import (
pathname_configs, DASH_ENV_VARS, get_combined_config, load_dash_env_vars)
from dash import exceptions as _exc
from dash import Dash, exceptions as _exc
from dash._utils import get_asset_path


Expand Down Expand Up @@ -138,5 +140,17 @@ def test_load_dash_env_vars_refects_to_os_environ(self):
self.assertEqual(vars[var], 'false')


@pytest.mark.parametrize('name, server, expected', [
(None, True, '__main__'),
('test', True, 'test'),
('test', False, 'test'),
(None, Flask('test'), 'test'),
('test', Flask('other'), 'test'),
])
def test_app_name_server(name, server, expected):
app = Dash(name=name, server=server)
assert app.config.name == expected


if __name__ == '__main__':
unittest.main()

0 comments on commit f4daea3

Please sign in to comment.