From a03e5ecaaaba8d89280b19411d15579107ceaf8f Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Thu, 19 Jan 2023 21:48:10 +0100 Subject: add a small test for maintenance mode --- tests/integration/test_smoke.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests/integration') diff --git a/tests/integration/test_smoke.py b/tests/integration/test_smoke.py index 1288da0..5176e88 100644 --- a/tests/integration/test_smoke.py +++ b/tests/integration/test_smoke.py @@ -2,3 +2,15 @@ def test_home(testapp): res = testapp.get("/") assert res.status_code == 200 assert b'

Home

' in res.body + + +def test_maintenance(testapp, data_manager): + # Enable the maintenance mode: + (data_manager.data_dir / "MAINTENANCE").write_text("Abbruch, abbruch!") + + try: + res = testapp.get("/", status=503) + assert b"Abbruch, abbruch" in res.body + finally: + # Make sure we disable maintenance mode for the following tests + (data_manager.data_dir / "MAINTENANCE").unlink() -- cgit v1.2.3