Skip to content

Commit

Permalink
refactor: move services modules to a more appropriate subpackage
Browse files Browse the repository at this point in the history
  • Loading branch information
julianolf committed May 10, 2024
1 parent a5d484e commit 189d686
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 6 deletions.
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file added tests/services/__init__.py
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import pytest

from fastapi_utils.dependencies import cloud_storage
from fastapi_utils.protocols import Uploader
from fastapi_utils.services import cloud_storage, protocols


@pytest.fixture
Expand All @@ -17,7 +16,7 @@ def storage_mock(monkeypatch: pytest.MonkeyPatch) -> MagicMock:
def test_uploader(storage_mock: MagicMock):
uploader = cloud_storage.Uploader()

assert isinstance(uploader, Uploader)
assert isinstance(uploader, protocols.Uploader)

uploader.upload("test-bucket", "destination.txt", "source.txt")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from fastapi.encoders import jsonable_encoder
from pydantic import BaseModel

from fastapi_utils.dependencies import pubsub
from fastapi_utils.protocols import Publisher
from fastapi_utils.services import protocols, pubsub

MAGIC_NUMBER = "42"

Expand All @@ -29,7 +28,7 @@ def pubsub_mock(monkeypatch: pytest.MonkeyPatch) -> MagicMock:
def test_publisher(pubsub_mock: MagicMock):
publisher = pubsub.Publisher()

assert isinstance(publisher, Publisher)
assert isinstance(publisher, protocols.Publisher)

topic = "projects/test-project/topics/test-topic"
message = MessageTest(content="test")
Expand Down

0 comments on commit 189d686

Please sign in to comment.