Purpose / Goal
The Python SDK is currently tested primarily via integration tests against the live sidecar. We need isolated unit tests for client.py to ensure the data conversion logic (_convert_market, etc.) is robust against API changes.
Tasks
Easy Way to Get Started
- Create a sample JSON file representing a market from the Polymarket API.
- In your test, pass this JSON to the
_convert_market function in client.py.
- Check if attributes like
market.title and market.yes.price match the JSON source.
Purpose / Goal
The Python SDK is currently tested primarily via integration tests against the live sidecar. We need isolated unit tests for
client.pyto ensure the data conversion logic (_convert_market, etc.) is robust against API changes.Tasks
sdks/python/tests/test_converters.py.pytestand \unittest.mock` to simulate the sidecar server's JSON responses.UnifiedMarket,OrderBook) are correctly instantiated with the expected values.Easy Way to Get Started
_convert_marketfunction inclient.py.market.titleandmarket.yes.pricematch the JSON source.