Skip to content

Commit

Permalink
local imports
Browse files Browse the repository at this point in the history
  • Loading branch information
CalebCourier committed May 31, 2024
1 parent fc72222 commit ceb47a0
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion tests/clients/test_guard_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from src.classes.http_error import HttpError

# from src.clients.memory_guard_client import MemoryGuardClient
from src.clients.pg_guard_client import PGGuardClient
from src.models.guard_item import GuardItem
from src.models.guard_item_audit import GuardItemAudit
from tests.mocks.mock_postgres_client import MockPostgresClient
Expand All @@ -15,6 +14,8 @@ def test_init(mocker):
mock_pg_client = MockPostgresClient()
mocker.patch("src.clients.pg_guard_client.PostgresClient", return_value=mock_pg_client)

from src.clients.pg_guard_client import PGGuardClient

pg_guard_client = PGGuardClient()
# mem_guard_client = MemoryGuardClient()

Expand All @@ -40,6 +41,9 @@ def test_get_latest(self, mocker):
"src.clients.pg_guard_client.GuardStruct.from_guard_item"
)
mock_from_guard_item.return_value = latest_guard

from src.clients.pg_guard_client import PGGuardClient


guard_client = PGGuardClient()

Expand Down Expand Up @@ -71,6 +75,8 @@ def test_with_as_of_date(self, mocker):
"src.clients.pg_guard_client.GuardStruct.from_guard_item"
)
mock_from_guard_item.return_value = previous_guard

from src.clients.pg_guard_client import PGGuardClient

guard_client = PGGuardClient()

Expand Down Expand Up @@ -108,6 +114,8 @@ def test_raises_not_found(self, mocker):
mock_from_guard_item = mocker.patch(
"src.clients.pg_guard_client.GuardStruct.from_guard_item"
)

from src.clients.pg_guard_client import PGGuardClient

guard_client = PGGuardClient()

Expand All @@ -132,6 +140,8 @@ def test_get_guard_item(mocker):
mock_first = mocker.patch.object(mock_pg_client.db.session, "first")
latest_guard = MockGuardStruct("latest")
mock_first.return_value = latest_guard

from src.clients.pg_guard_client import PGGuardClient

guard_client = PGGuardClient()

Expand Down Expand Up @@ -160,6 +170,8 @@ def test_get_guards(mocker):
)
mock_from_guard_item.side_effect = [guard_one, guard_two]

from src.clients.pg_guard_client import PGGuardClient

guard_client = PGGuardClient()

result = guard_client.get_guards()
Expand Down Expand Up @@ -189,6 +201,8 @@ def test_create_guard(mocker):
)
mock_from_guard_item.return_value = mock_guard

from src.clients.pg_guard_client import PGGuardClient

guard_client = PGGuardClient()

result = guard_client.create_guard(mock_guard)
Expand Down Expand Up @@ -229,6 +243,8 @@ def test_raises_not_found(self, mocker):
mock_from_guard_item = mocker.patch(
"src.clients.pg_guard_client.GuardStruct.from_guard_item"
)

from src.clients.pg_guard_client import PGGuardClient

guard_client = PGGuardClient()

Expand Down Expand Up @@ -264,6 +280,8 @@ def test_updates_guard_item(self, mocker):
)
mock_from_guard_item.return_value = updated_guard

from src.clients.pg_guard_client import PGGuardClient

guard_client = PGGuardClient()

result = guard_client.update_guard("mock-guard", updated_guard)
Expand Down Expand Up @@ -301,6 +319,8 @@ def test_guard_doesnt_exist_yet(self, mocker):
"src.clients.pg_guard_client.PGGuardClient.create_guard"
)
mock_create_guard.return_value = new_guard

from src.clients.pg_guard_client import PGGuardClient

guard_client = PGGuardClient()

Expand Down Expand Up @@ -331,6 +351,8 @@ def test_guard_already_exists(self, mocker):
"src.clients.pg_guard_client.GuardStruct.from_guard_item"
)
mock_from_guard_item.return_value = updated_guard

from src.clients.pg_guard_client import PGGuardClient

guard_client = PGGuardClient()

Expand Down Expand Up @@ -363,6 +385,8 @@ def test_raises_not_found(self, mocker):
mock_from_guard_item = mocker.patch(
"src.clients.pg_guard_client.GuardStruct.from_guard_item"
)

from src.clients.pg_guard_client import PGGuardClient

guard_client = PGGuardClient()

Expand Down Expand Up @@ -396,6 +420,8 @@ def test_deletes_guard_item(self, mocker):
"src.clients.pg_guard_client.GuardStruct.from_guard_item"
)
mock_from_guard_item.return_value = old_guard

from src.clients.pg_guard_client import PGGuardClient

guard_client = PGGuardClient()

Expand Down

0 comments on commit ceb47a0

Please sign in to comment.