Skip to content

Commit

Permalink
test(storage): add test for get_posts_by_ids empty case
Browse files Browse the repository at this point in the history
  • Loading branch information
osoken committed Mar 24, 2024
1 parent 6f6a6ee commit 243b871
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/test_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from sqlalchemy.engine import Engine

from birdxplorer.models import Post, Topic
from birdxplorer.models import Post, PostId, Topic
from birdxplorer.storage import NoteRecord, PostRecord, Storage, TopicRecord


Expand Down Expand Up @@ -43,3 +43,17 @@ def test_get_posts_by_ids(
expected = [post_samples[i] for i in (0, 2)]
actual = list(storage.get_posts_by_ids(post_ids))
assert expected == actual


def test_get_posts_by_ids_empty(
engine_for_test: Engine,
post_samples: List[Post],
post_records_sample: List[PostRecord],
topic_records_sample: List[TopicRecord],
note_records_sample: List[NoteRecord],
) -> None:
storage = Storage(engine=engine_for_test)
post_ids: List[PostId] = []
expected: List[Post] = []
actual = list(storage.get_posts_by_ids(post_ids))
assert expected == actual

0 comments on commit 243b871

Please sign in to comment.