Add pytest suite and GitHub Actions CI - #2
Merged
Merged
Conversation
The project had no tests and no CI; the tools hit the live Venmo API (some move real money), so coverage targets the network-free logic instead. - conftest.py: FakeClient/FakeUserApi + transaction/user builders so tests never touch the network or move money. - tests/test_helpers.py: epoch->UTC-ISO conversion, user flattening, and the full direction matrix (pay/charge x actor/target). - tests/test_get_transactions.py: routing (with_user_id -> get_transaction_between_two_users), note_contains filtering, and limit/before_id pass-through. - pixi `test` task + pytest dependency. - .github/workflows/ci.yml: runs `pixi run test` on push/PR to main with a locked environment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 the project's first tests and CI. Follow-up to #1, which merged with no automated gate.
Why network-free
Every tool calls the live Venmo API and some move real money, so tests can't run the tools for real in CI. Instead they cover the separable logic with a faked client — zero network, zero money.
Coverage (18 tests)
tests/test_helpers.py): epoch→UTC-ISO conversion (incl.None/empty/garbage fallbacks), user flattening, and the fulldirectionmatrix —pay/charge× actor/target →sent/received/you_requested/requested_from_you.get_transactions(tests/test_get_transactions.py): routes toget_transaction_between_two_userswhenwith_user_idis set (elseget_user_transactions),note_containscase-insensitive filtering, empty→no-match, andlimit/before_idpass-through (incl.""→None).Plumbing
conftest.pyat repo root (soimport serverresolves):FakeClient/FakeUserApirecorders + transaction/user builders.testtask inpixi.toml;pytestadded as a dependency (lockfile updated)..github/workflows/ci.yml: runspixi run teston push/PR tomainwithlocked: truefor a reproducible env.Local run:
18 passed in 0.23s.🤖 Generated with Claude Code