Add unit tests - #7
Merged
dariomory merged 3 commits intoApr 18, 2026
Merged
Conversation
Contributor
Author
|
Run the tests using |
Owner
|
@TisaneFruitRouge can you check the CI? |
Contributor
Author
Sure |
dariomory
approved these changes
Apr 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a comprehensive unit test suite (267 tests across 9 files) covering enums, models, parsers, exporters, exceptions, transport, session, and fetcher layers. Also fixes a bug in _normalize_timeout
where httpx.Timeout(connect=a, read=b) raised a ValueError on httpx 0.28 — the call now passes a positional default: httpx.Timeout(b, connect=a, read=b).
AI Provenance
test coverage. The model first performed a full codebase exploration — reading every source file under src/trendflow/, mapping all classes, methods, return types, exception paths, and mock boundaries —
before writing a single test. Tests were then written bottom-up (pure helpers first, then models, parsers, exporters, exceptions, transport, session, fetcher, and public API), with shared fixtures
extracted into conftest.py. After the first full run, two categories of failures emerged: a missing RegionalInterestRow export from the package root (fixed in the test import), and a real source-level
incompatibility in _normalize_timeout with httpx 0.28. The bug was diagnosed from the traceback, confirmed against the httpx API, and patched in the source. All 267 tests pass on Python 3.14.
Checklist
[X] Addresses exactly one issue or feature
[X] New or changed behavior has test coverage
[X] Diff contains only changes for this task