From 92d495dfd5d29eb69d33e5af44babcc9a13c184c Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 22 Sep 2021 14:48:40 +0300 Subject: [PATCH] add test_api_restart_flag --- tests/test_pub1c-rest.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_pub1c-rest.py b/tests/test_pub1c-rest.py index 0fed42f..14461ed 100644 --- a/tests/test_pub1c-rest.py +++ b/tests/test_pub1c-rest.py @@ -58,3 +58,17 @@ def test_api_index(client): data = response.get_json() assert data == ['infobases-available', 'infobases-all', 'publications', 'module', 'config', 'config-test', 'apache-restart'] + + +def test_api_restart_flag(client): + endpoint = '/api/v1/apache-restart' + # test when flag not set + response = client.get(endpoint) + assert 404 == response.status_code + # set flag + response = client.put(endpoint) + assert 200 == response.status_code + # test when flag is set + response = client.get(endpoint) + assert 200 == response.status_code +