Skip to content

Commit

Permalink
API側既存テストの修正
Browse files Browse the repository at this point in the history
  • Loading branch information
sushichan044 committed Sep 30, 2024
1 parent 44fdc99 commit 9666eb6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions api/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def post_samples(post_factory: PostFactory, x_user_samples: List[XUser]) -> Gene
新しいプロジェクトがついに公開されました!詳細はこちら👉
https://t.co/xxxxxxxxxxx/ #プロジェクト #新発売 #Tech""",
media_details=None,
media_details=[],
created_at=1152921600000,
like_count=10,
repost_count=20,
Expand All @@ -184,7 +184,7 @@ def post_samples(post_factory: PostFactory, x_user_samples: List[XUser]) -> Gene
このブログ記事、めちゃくちゃ参考になった!🔥 チェックしてみて!
https://t.co/yyyyyyyyyyy/ #学び #自己啓発""",
media_details=None,
media_details=[],
created_at=1153921700000,
like_count=10,
repost_count=20,
Expand All @@ -196,7 +196,7 @@ def post_samples(post_factory: PostFactory, x_user_samples: List[XUser]) -> Gene
x_user=x_user_samples[1],
text="""\
次の休暇はここに決めた!🌴🏖️ 見てみて~ https://t.co/xxxxxxxxxxx/ #旅行 #バケーション""",
media_details=None,
media_details=[],
created_at=1154921800000,
like_count=10,
repost_count=20,
Expand Down Expand Up @@ -262,6 +262,7 @@ def _get_posts(
search_text: Union[str, None] = None,
offset: Union[int, None] = None,
limit: Union[int, None] = None,
with_media: bool = True,
) -> Generator[Post, None, None]:
gen_count = 0
actual_gen_count = 0
Expand All @@ -284,6 +285,8 @@ def _get_posts(
if offset is not None and gen_count <= offset:
continue
actual_gen_count += 1
if not with_media:
post.media_details = []
yield post

mock.get_posts.side_effect = _get_posts
Expand Down

0 comments on commit 9666eb6

Please sign in to comment.