Skip to content

Commit

Permalink
Fixed legacy /tasks view tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Collins committed Jul 22, 2020
1 parent 185547d commit 3117b74
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tests/test_default_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def task_func():
task_obj = current_labthing().actions.spawn(task_func)

with thing_client as c:
response = c.get("/actions").json
response = c.get("/tasks").json
ids = [task.get("id") for task in response]
assert str(task_obj.id) in ids

Expand All @@ -116,13 +116,13 @@ def task_func():
task_id = str(task_obj.id)

with thing_client as c:
response = c.get(f"/actions/{task_id}").json
response = c.get(f"/tasks/{task_id}").json
assert response


def test_task_representation_missing(thing_client):
with thing_client as c:
assert c.get("/actions/missing_id").status_code == 404
assert c.get("/tasks/missing_id").status_code == 404


def test_task_kill(thing_client):
Expand All @@ -139,12 +139,12 @@ def task_func():

# Send a DELETE request to terminate the task
with thing_client as c:
response = c.delete(f"/actions/{task_id}")
response = c.delete(f"/tasks/{task_id}")
assert response.status_code == 200
# Test task was stopped
assert task_obj._status == "stopped"


def test_task_kill_missing(thing_client):
with thing_client as c:
assert c.delete("/actions/missing_id").status_code == 404
assert c.delete("/tasks/missing_id").status_code == 404

0 comments on commit 3117b74

Please sign in to comment.