add test_api_restart_flag

This commit is contained in:
Dmitry Belyaev 2021-09-22 14:48:40 +03:00
parent b2e2cda3ea
commit 92d495dfd5
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3

View File

@ -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