Skip to content

test: expand normalize test coverage for all source types#147

Open
JiayuuWang wants to merge 1 commit intomvanhorn:mainfrom
JiayuuWang:contribot/add-normalize-tests
Open

test: expand normalize test coverage for all source types#147
JiayuuWang wants to merge 1 commit intomvanhorn:mainfrom
JiayuuWang:contribot/add-normalize-tests

Conversation

@JiayuuWang
Copy link
Copy Markdown

Summary

  • test_normalize.py previously covered only normalize_reddit_items, normalize_x_items, and items_to_dicts — leaving filter_by_date_range and six source normalizers with zero test coverage.
  • Adds 25 new tests covering all normalizer functions in normalize.py.

What's covered

Function Tests added
filter_by_date_range in-range, before range, after range, boundary dates, unknown date (keep/drop)
normalize_youtube_items basic fields, engagement mapping, missing engagement
normalize_tiktok_items basic fields, sequential TK-IDs, engagement + shares field
normalize_instagram_items basic fields, engagement
normalize_hackernews_items basic fields, engagement (points → score), top_comments
normalize_bluesky_items basic fields, engagement including quotes
normalize_truthsocial_items basic fields, engagement
normalize_polymarket_items basic fields, volume1mo preference over volume24hr, volume24hr fallback

Test plan

  • python -m pytest tests/test_normalize.py — 31 passed (was 6)
  • python -m pytest tests/ — full suite passes with no regressions

🤖 Generated with Claude Code

The normalize module had tests only for Reddit and X items, leaving
filter_by_date_range and six source normalizers (YouTube, TikTok,
Instagram, HackerNews, Bluesky, TruthSocial, Polymarket) entirely
uncovered. This adds 25 new tests covering:

- filter_by_date_range: in-range, before/after range, boundary dates,
  unknown date handling with/without require_date
- normalize_youtube_items: basic fields, engagement, missing engagement
- normalize_tiktok_items: basic fields, sequential TK-IDs, engagement/shares
- normalize_instagram_items: basic fields, engagement
- normalize_hackernews_items: basic fields, engagement, top_comments
- normalize_bluesky_items: basic fields, engagement including quotes
- normalize_truthsocial_items: basic fields, engagement
- normalize_polymarket_items: basic fields, volume1mo preference over
  volume24hr, volume24hr fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant