diff --git a/tests/test_access/tst_access_drogon_read_login.py b/tests/test_access/tst_access_drogon_read_login.py index d38c29d4..f314cd4d 100644 --- a/tests/test_access/tst_access_drogon_read_login.py +++ b/tests/test_access/tst_access_drogon_read_login.py @@ -75,6 +75,23 @@ def test_write(explorer: Explorer): print("Execution should never reach this line") +def test_delete(explorer: Explorer): + """Test a delete method""" + print("Running test:", inspect.currentframe().f_code.co_name) + + with pytest.raises(Exception, match="403*"): + res = explorer._sumo.delete(f"/objects('dcff880f-b35b-3598-08bc-2a408c85d204')") + print("Execution should never reach this line") + print("Unexpected status: ", res.status_code) + print("Unexpected response: ", res.text) + + with pytest.raises(Exception, match="403*"): + res = explorer._sumo.delete(f"/objects('392c3c70-dd1a-41b5-ac49-0e369a0ac4eb')") + print("Execution should never reach this line") + print("Unexpected status: ", res.status_code) + print("Unexpected response: ", res.text) + + def test_read_restricted_classification_data(explorer: Explorer): """Test if can read restriced data aka 'access:classification: restricted'""" print("Running test:", inspect.currentframe().f_code.co_name) diff --git a/tests/test_access/tst_access_no_access_login.py b/tests/test_access/tst_access_no_access_login.py index 5322a91d..af0e58b5 100644 --- a/tests/test_access/tst_access_no_access_login.py +++ b/tests/test_access/tst_access_no_access_login.py @@ -77,6 +77,21 @@ def test_write(explorer: Explorer): print("Unexpected status: ", response.status_code) print("Unexpected response: ", response.text) +def test_delete(explorer: Explorer): + """Test a delete method""" + print("Running test:", inspect.currentframe().f_code.co_name) + + with pytest.raises(Exception, match="403*"): + res = explorer._sumo.delete(f"/objects('dcff880f-b35b-3598-08bc-2a408c85d204')") + print("Execution should never reach this line") + print("Unexpected status: ", res.status_code) + print("Unexpected response: ", res.text) + + with pytest.raises(Exception, match="403*"): + res = explorer._sumo.delete(f"/objects('392c3c70-dd1a-41b5-ac49-0e369a0ac4eb')") + print("Execution should never reach this line") + print("Unexpected status: ", res.status_code) + print("Unexpected response: ", res.text) def test_read_restricted_classification_data(explorer: Explorer): """Test if can read restriced data aka 'access:classification: restricted'"""