From e8341cb899107717fb49f3a6a5837e5f9d718d78 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 22 Sep 2021 15:19:02 +0300 Subject: [PATCH] add test_api_module --- tests/test_pub1c-rest.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_pub1c-rest.py b/tests/test_pub1c-rest.py index f0fed14..07ba624 100644 --- a/tests/test_pub1c-rest.py +++ b/tests/test_pub1c-rest.py @@ -98,3 +98,19 @@ def test_api_config(client): actual.sort() 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 +