Skip to content

Commit

Permalink
feat: refactor tests classes
Browse files Browse the repository at this point in the history
  • Loading branch information
pmareke committed Sep 24, 2024
1 parent a4a2e77 commit 9fda090
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tests/acceptance/delivery/api/test_heath_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from main import app, settings


class TestHealthController:
class TestHealthControllerAcceptance:
@pytest.fixture
def client(self) -> TestClient:
return TestClient(app)
Expand Down
2 changes: 1 addition & 1 deletion tests/acceptance/delivery/api/test_hello_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from main import app, settings


class TestHelloController:
class TestHelloControllerAcceptance:
@pytest.fixture
def client(self) -> TestClient:
return TestClient(app)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from src.infrastructure.hello.hello_client import DummyHelloClient


class TestDummyHelloClientIntegrtion:
class TestDummyHelloClientIntegration:
def test_get_name(self) -> None:
expected_name = "Yes"
client = DummyHelloClient()
Expand Down
9 changes: 2 additions & 7 deletions tests/unit/acceptance/delivery/api/test_hello_controller.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import pytest

from doublex import ANY_ARG, Mimic, Stub
from expects import expect, equal
from fastapi.testclient import TestClient
Expand All @@ -19,11 +17,8 @@ def _failing_handler(self) -> SayHelloCommandHandler:
self.handler.execute(ANY_ARG).raises(exception)
return self.handler # type: ignore

@pytest.fixture
def client(self) -> TestClient:
return TestClient(app)

def test_hello_controller(self, client: TestClient) -> None:
def test_hello_controller(self) -> None:
client = TestClient(app)
app.dependency_overrides[say_hello_command_handler] = self._failing_handler
invalid_name = "any-invalid-name"

Expand Down

0 comments on commit 9fda090

Please sign in to comment.