diff --git a/tests/test_helpers.py b/tests/test_helpers.py index cda9a64..130e10e 100644 --- a/tests/test_helpers.py +++ b/tests/test_helpers.py @@ -3,7 +3,7 @@ import pytest from teuthology_api.main import app from unittest.mock import patch -from teuthology_api.services.helpers import Request, get_token, get_username +from teuthology_api.services.helpers import get_token, get_username client = TestClient(app) diff --git a/tests/test_kill.py b/tests/test_kill.py index 7a30953..887b2a2 100644 --- a/tests/test_kill.py +++ b/tests/test_kill.py @@ -39,12 +39,12 @@ def test_kill_run_success(m_get_username, m_get_run_details, m_popen): mock_process = m_popen.return_value mock_process.communicate.return_value = ("logs", "") mock_process.wait.return_value = 0 - response = client.post("/kill", data=json.dumps(mock_kill_args)) + response = client.post("/kill", content=json.dumps(mock_kill_args)) assert response.status_code == 200 assert response.json() == {"kill": "success"} def test_kill_run_fail(): - response = client.post("/kill", data=json.dumps(mock_kill_args)) + response = client.post("/kill", content=json.dumps(mock_kill_args)) assert response.status_code == 401 assert response.json() == {"detail": "You need to be logged in"} diff --git a/tests/test_suite.py b/tests/test_suite.py index ab2f6f7..99cb9b1 100644 --- a/tests/test_suite.py +++ b/tests/test_suite.py @@ -35,7 +35,7 @@ async def override_get_token(): def test_suite_run_success(m_get_run_details, m_get_username, m_logs_run): m_get_username.return_value = "user1" m_get_run_details.return_value = {"id": "7451978", "user": "user1"} - response = client.post("/suite", data=json.dumps(mock_suite_args)) + response = client.post("/suite", content=json.dumps(mock_suite_args)) assert response.status_code == 200 assert response.json() == {"run": {"id": "7451978", "user": "user1"}}