Skip to content

Commit

Permalink
feat: reorganize imports
Browse files Browse the repository at this point in the history
  • Loading branch information
pmareke committed Sep 25, 2024
1 parent 61e6316 commit 7e53951
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 21 deletions.
5 changes: 3 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import logging

from collections.abc import AsyncGenerator
from contextlib import asynccontextmanager
from time import sleep

from fastapi import FastAPI

from src.common.logger import setup_logging
from src.common.settings import Settings
from src.delivery.api.v1.health.health_router import health
from src.delivery.api.v1.hello.hello_router import hello
from time import sleep


@asynccontextmanager
Expand Down
2 changes: 1 addition & 1 deletion src/delivery/api/v1/health/health_router.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from fastapi import APIRouter, Depends

from src.domain.command import CommandHandler
from src.delivery.api.v1.health.health_response import HealthResponse
from src.domain.command import CommandHandler
from src.use_cases.health_command import HealthCommand, HealthCommandHandler

health: APIRouter = APIRouter()
Expand Down
12 changes: 7 additions & 5 deletions src/delivery/api/v1/hello/hello_router.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
from fastapi import APIRouter, Depends, HTTPException
from http.client import BAD_REQUEST

from fastapi import APIRouter, Depends, HTTPException

from src.delivery.api.v1.hello.hello_response import HelloResponse
from src.domain.command import CommandHandler
from src.domain.exceptions import SayHelloCommandHandlerException
from src.domain.hello_client import HelloClient
from src.infrastructure.hello.hello_client import DummyHelloClient
from src.use_cases.say_hello_command import (
SayHelloCommand,
SayHelloCommandHandler,
)
from src.domain.command import CommandHandler
from src.domain.hello_client import HelloClient
from src.delivery.api.v1.hello.hello_response import HelloResponse
from src.infrastructure.hello.hello_client import DummyHelloClient

hello: APIRouter = APIRouter()

Expand Down
1 change: 0 additions & 1 deletion src/domain/command.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import uuid

from abc import ABC, abstractmethod
from typing import Any

Expand Down
3 changes: 2 additions & 1 deletion src/use_cases/health_command.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from logging import Logger
import logging
from logging import Logger

from src.domain.command import Command, CommandHandler, CommandResponse


Expand Down
2 changes: 1 addition & 1 deletion src/use_cases/say_hello_command.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging

from logging import Logger

from src.domain.command import Command, CommandHandler, CommandResponse
from src.domain.exceptions import (
SayHelloClientException,
Expand Down
7 changes: 4 additions & 3 deletions tests/acceptance/delivery/api/test_heath_controller.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import pytest
from http.client import OK

from expects import expect, equal
import pytest
from expects import equal, expect
from fastapi.testclient import TestClient
from http.client import OK

from main import app, settings


Expand Down
7 changes: 4 additions & 3 deletions tests/acceptance/delivery/api/test_hello_controller.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import pytest
from http.client import OK

from expects import expect, equal
import pytest
from expects import equal, expect
from fastapi.testclient import TestClient
from http.client import OK

from main import app, settings


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from expects import equal, expect, raise_error

from src.domain.exceptions import SayHelloClientException
from src.infrastructure.hello.hello_client import DummyHelloClient

Expand Down
6 changes: 4 additions & 2 deletions tests/unit/acceptance/delivery/api/test_hello_controller.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from http.client import BAD_REQUEST

from doublex import ANY_ARG, Mimic, Stub
from expects import expect, equal
from expects import equal, expect
from fastapi.testclient import TestClient
from http.client import BAD_REQUEST

from main import app, settings
from src.delivery.api.v1.hello.hello_router import say_hello_command_handler
from src.domain.exceptions import SayHelloCommandHandlerException
Expand Down
1 change: 1 addition & 0 deletions tests/unit/use_cases/test_health_command.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from expects import be_true, expect

from src.use_cases.health_command import HealthCommand, HealthCommandHandler


Expand Down
5 changes: 3 additions & 2 deletions tests/unit/use_cases/test_say_hello_command.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from expects import equal, expect, raise_error
from doublex import Mimic, Stub
from expects import equal, expect, raise_error

from src.domain.exceptions import (
SayHelloCommandHandlerException,
SayHelloClientException,
SayHelloCommandHandlerException,
)
from src.infrastructure.hello.hello_client import DummyHelloClient
from src.use_cases.say_hello_command import SayHelloCommand, SayHelloCommandHandler
Expand Down

0 comments on commit 7e53951

Please sign in to comment.