Add unit tests for Go, Python, and JS/TS REST clients - #15
Merged
Conversation
- antd-go: add 6 tests for wallet and external signer methods (WalletAddress, WalletBalance, WalletApprove, PrepareUpload, PrepareDataUpload, FinalizeUpload) using httptest mock daemon - antd-py: add 14 tests for REST client using threaded mock HTTP server — covers health, data, chunks, wallet, and error mapping (404→NotFoundError, 400→BadRequestError, 502→NetworkError) - antd-js: add 31 vitest tests for REST client with mocked fetch — covers all endpoints, error status mapping (7 codes), network errors, timeout handling, and constructor options All tests verified passing: Go 13/13, Python 14/14, JS 31/31. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- antd-rust: remove graph.proto from build.rs, delete dead 05-graph example, remove Cargo.toml example entry, update tests and examples to pass payment_mode parameter (added in prior commit), fix doctest - antd-csharp: remove graph.proto from csproj, add wallet and external signer stubs to gRPC client (NotSupportedException) All test suites now pass: Go: 35 pass | Python: 43 pass | JS: 31 pass | Rust: 55 pass PHP: 23 pass | Dart: 43 pass | C#: builds clean (integration tests) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- antd-zig: remove parseGraphEntry, GraphDescendant from json_helpers and 3 graph-related tests from tests.zig - antd-csharp: already fixed graph.proto in csproj (prior commit) - antd-kotlin: proto files copied by gradle copyProtos task (no graph) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- lib/build.gradle.kts: add afterEvaluate block to ensure generateProto depends on copyProtos (was running before proto files were copied) - lib/build.gradle.kts: add junit-platform-launcher to test runtime (was failing with "Failed to load JUnit Platform") - examples/build.gradle.kts: add kotlinx-coroutines-core dependency (examples use runBlocking which requires coroutines on classpath) Kotlin tests now pass: 7/7 (SmokeTests). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests run against a real antd daemon (default http://127.0.0.1:51105, override via ANTD_TEST_URL env var). All gracefully skip when no daemon is reachable, so CI still passes without infrastructure. - antd-go: 8 integration tests (health, error mapping for no-wallet, invalid address, missing upload_id, no-peers cost) - antd-py: 7 integration tests (health, BadRequestError for invalid hex, NotFoundError for valid-but-missing address, ServiceUnavailable for wallet ops, error for cost without peers) - antd-js: 8 integration tests (health, ServiceUnavailableError, BadRequestError, AntdError, NetworkError on unreachable port) Verified all 23 tests passing against antd in local mode (no wallet, no peers). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
22 tests covering all REST client operations: health, data (public/ private), chunks, wallet, archives, files, external signer, and error mapping for 6 HTTP status codes. Uses a lightweight HttpListener-based mock server — no external mocking libraries required. C# now has parity with the other SDK test suites. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
All tests verified passing locally.
Test plan
go test ./...— 13/13 passpytest tests/test_rest_client.py— 14/14 passnpx vitest run— 31/31 pass🤖 Generated with Claude Code