Skip to content

feat(python): add unit tests for client wrapper#68

Open
Bortlesboat wants to merge 1 commit intopmxt-dev:mainfrom
Bortlesboat:feat/python-unit-tests
Open

feat(python): add unit tests for client wrapper#68
Bortlesboat wants to merge 1 commit intopmxt-dev:mainfrom
Bortlesboat:feat/python-unit-tests

Conversation

@Bortlesboat
Copy link
Copy Markdown

Summary

  • Adds 77 unit tests across 9 test classes for the Python SDK client wrapper
  • Covers converters, error handling, market list matching, exchange init, API methods, auth headers, and filter methods
  • All tests use pytest + unittest.mock (no real HTTP calls)
  • Addresses [Python] Unit Tests for Client Wrapper (Mocks) #20

Test plan

  • pytest sdks/python/tests/ passes locally
  • Tests mock the pmxt_internal module so they run without npm run generate

Adds 77 mock-based unit tests covering the Python SDK client:
- Data model converters (market, event, order, trade, position, etc.)
- Error class hierarchy and server error parsing
- MarketList.match() convenience method
- Exchange initialization and credential handling
- API method calls with mocked HTTP responses
- Response handling (success and error paths)
- Low-level call_api / _call_method
- Auth header construction
- Local filter_markets / filter_events

Also adds conftest.py to mock the auto-generated pmxt_internal module
so unit tests can run without generating the OpenAPI client.
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