Skip to content

Commit

Permalink
delete tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ZohebShaikh committed Oct 16, 2024
1 parent b2a45fd commit 57b1231
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions tests/unit_tests/service/test_rest_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import uuid
from collections.abc import Iterator
from dataclasses import dataclass
Expand All @@ -24,33 +23,6 @@
from blueapi.worker.task_worker import TrackableTask


@pytest.fixture
def client_with_authentication() -> Iterator[TestClient]:
os.environ["PKCE_AUTHENTICATION_URL"] = "http://localhost:8080"
os.environ["TOKEN_URL"] = "http://localhost:8080"
with patch("blueapi.service.interface.worker"):
main.setup_runner(use_subprocess=False)
yield TestClient(main.app)
main.teardown_runner()
del os.environ["PKCE_AUTHENTICATION_URL"]
del os.environ["TOKEN_URL"]


@patch("blueapi.service.interface.get_plans")
def test_get_plans_gives_auth_error(
get_plans_mock: MagicMock, client_with_authentication: TestClient
) -> None:
class MyModel(BaseModel):
id: str

plan = Plan(name="my-plan", model=MyModel)
get_plans_mock.return_value = [PlanModel.from_plan(plan)]

response = client_with_authentication.get("/plans")

assert response.status_code == status.HTTP_401_UNAUTHORIZED


@pytest.fixture
def client() -> Iterator[TestClient]:
with patch("blueapi.service.interface.worker"):
Expand Down

0 comments on commit 57b1231

Please sign in to comment.