-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or improvementNew feature or improvementpriority:mediumMedium priorityMedium priority
Description
Summary
The current test suites in both Python and TypeScript SDKs only cover initialization, validation, and searchAsset() request/response handling. Core operations that interact with the API lack unit tests with mocked HTTP responses.
Missing Test Coverage
Both SDKs:
register()— No tests verifying multipart form construction, signing flow, or file normalization with mocked APIupdate()— No tests verifying PATCH request construction or metadata serializationget()— No tests verifying GET request and response parsinggetHistory()/get_history()— No tests verifying history API URL construction, query parameters (especially testnet flag), or commit response parsinggetAssetTree()/get_asset_tree()— No tests verifying the two-step flow (history fetch → merge request) or AssetTree response parsingsearchNft()/search_nft()— No tests verifying NFT search request or response parsing
Python-specific:
python/tests/test_asset_search.pyandpython/tests/test_asset_tree.pyexist but only coversearchAssetandgetAssetTreepartially- No tests for
_normalize_file()with Path objects or error cases
TypeScript-specific:
ts/src/client.test.tsonly testssearchAssetrequest/response and constructor validation- No tests for
normalizeFile()with different input types (File, Blob, Buffer)
Suggested Approach
-
For each untested method, create test cases that:
- Mock the HTTP client (
respxfor Python,vi.fnfor fetch in TypeScript) - Verify correct URL construction and headers
- Verify request body format (multipart, JSON, query params)
- Verify response parsing into typed SDK objects
- Test error handling for various HTTP status codes
- Mock the HTTP client (
-
Aim for >80% line coverage across both SDKs.
Priority
Medium — the SDK works correctly based on integration testing, but unit tests would catch regressions faster and improve contributor confidence.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or improvementNew feature or improvementpriority:mediumMedium priorityMedium priority