Skip to content

Add pytest suite and GitHub Actions CI - #2

Merged
aaymeloglu merged 1 commit into
mainfrom
add-tests-and-ci
Jun 7, 2026
Merged

Add pytest suite and GitHub Actions CI#2
aaymeloglu merged 1 commit into
mainfrom
add-tests-and-ci

Conversation

@aaymeloglu

Copy link
Copy Markdown
Owner

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)

  • Helpers (tests/test_helpers.py): epoch→UTC-ISO conversion (incl. None/empty/garbage fallbacks), user flattening, and the full direction matrix — pay/charge × actor/target → sent/received/you_requested/requested_from_you.
  • get_transactions (tests/test_get_transactions.py): routes to get_transaction_between_two_users when with_user_id is set (else get_user_transactions), note_contains case-insensitive filtering, empty→no-match, and limit/before_id pass-through (incl. ""None).

Plumbing

  • conftest.py at repo root (so import server resolves): FakeClient/FakeUserApi recorders + transaction/user builders.
  • test task in pixi.toml; pytest added as a dependency (lockfile updated).
  • .github/workflows/ci.yml: runs pixi run test on push/PR to main with locked: true for a reproducible env.

Local run: 18 passed in 0.23s.

🤖 Generated with Claude Code

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>
@aaymeloglu
aaymeloglu merged commit 15b0cf2 into main Jun 7, 2026
1 check passed
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