feat(tests): Expand unit test coverage for core SDK operations#12
Draft
feat(tests): Expand unit test coverage for core SDK operations#12
Conversation
- TypeScript: add 47 new tests for register, update, get, getHistory, getAssetTree, searchNft, and normalizeFile (15 → 62 total tests) - Python: add 53 new tests in test_core_operations.py covering register, update, get, get_history, search_nft, and _normalize_file edge cases - Python coverage improved from 71% to 89% (client.py: 50% → 82%) - All tests mock HTTP responses; no real network calls made Co-authored-by: numbers-official <181934381+numbers-official@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add unit tests for core SDK operations
feat(tests): Expand unit test coverage for core SDK operations
Feb 27, 2026
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.
Both SDKs lacked unit tests for core operations (
register,update,get,getHistory/get_history,getAssetTree/get_asset_tree,searchNft/search_nft), relying solely on integration tests to catch regressions.TypeScript —
ts/src/client.test.tsdescribeblocksAuthorizationheader, request body format (multipart vs. JSON), response parsing, and error type mapping (401 →AuthenticationError, 404 →NotFoundError, 500 →NetworkError)getAssetTreetests verify the two-step fetch sequence (history → merge) and correct commit data forwardingnormalizeFiletested indirectly viaregisterwithUint8Array,Blob, and missing-filename error pathsPython —
python/tests/test_core_operations.py(new file)respxmocks, matching parity with TypeScript coverageTestNormalizeFileclass coveringstr/Path/bytes/bytearrayinputs, nonexistent path errors, MIME inference across common extensions, andapplication/octet-streamfallbackunquote_plusfor accurate field assertionsCoverage delta
client.pyOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.