Skip to content

Commit

Permalink
Test config should_reload property (#899)
Browse files Browse the repository at this point in the history
* Test config should_reload property

* Separate test
  • Loading branch information
euri10 authored Dec 19, 2020
1 parent 1841655 commit cdb6873
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ def test_debug_app():
assert isinstance(config.loaded_app, DebugMiddleware)


@pytest.mark.parametrize(
"app, expected_should_reload",
[(asgi_app, False), ("tests.test_config:asgi_app", True)],
)
def test_config_should_reload_is_set(app, expected_should_reload):
config_debug = Config(app=app, debug=True)
assert config_debug.debug is True
assert config_debug.should_reload is expected_should_reload

config_reload = Config(app=app, reload=True)
assert config_reload.reload is True
assert config_reload.should_reload is expected_should_reload


def test_wsgi_app():
config = Config(app=wsgi_app, interface="wsgi", proxy_headers=False)
config.load()
Expand Down

0 comments on commit cdb6873

Please sign in to comment.