Skip to content

Commit

Permalink
test: Add a test to check that an expired TD is deleted after clear_e…
Browse files Browse the repository at this point in the history
…xpired_td
  • Loading branch information
Murloc6 committed Aug 30, 2023
1 parent 2ab3e36 commit d8c5407
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from jsoncomparison import Compare
from rdflib import Graph
from rdflib.compare import graph_diff
from tdd.td import clear_expired_td

from tests.conftest import (
DATA_PATH,
Expand Down Expand Up @@ -33,6 +34,15 @@ def test_GET_thing_OK(test_client, mock_sparql_with_one_td):
assert_only_on_known_errors(diff)


def test_GET_expired_thing(test_client, mock_sparql_with_one_expired_td):
td_id = "urn:uuid:55f01138-5c96-4b3d-a5d0-81319a2db677"
get_response = test_client.get(f"/things/{td_id}")
assert get_response.status_code == 200
clear_expired_td()
get_response = test_client.get(f"/things/{td_id}")
assert get_response.status_code == 404


def test_GET_thing_content_negociation(test_client, mock_sparql_with_one_td):
td_id = "urn:uuid:55f01138-5c96-4b3d-a5d0-81319a2db677"
for mime_type, file_extension in [
Expand Down

0 comments on commit d8c5407

Please sign in to comment.