add test_api_module

This commit is contained in:
Dmitry Belyaev 2021-09-22 15:19:02 +03:00
parent 7f87191f2a
commit e8341cb899
Signed by: b4tman
GPG Key ID: 41A00BF15EA7E5F3

View File

@ -98,3 +98,19 @@ def test_api_config(client):
actual.sort() actual.sort()
assert actual == expected assert actual == expected
def test_api_module(client):
endpoint = '/api/v1/module'
# test when module not added
response = client.get(endpoint)
assert 404 == response.status_code
# add module
response = client.put(endpoint)
assert 200 == response.status_code
# test when module added
response = client.get(endpoint)
assert 200 == response.status_code
# try to add module again
response = client.put(endpoint)
assert 304 == response.status_code