-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Overview
Created integration test scripts to verify the published SDK packages work correctly after release. Both TypeScript (npm) and Python (PyPI) packages were tested with the complete workflow.
Files Created
integration-tests/
├── package.json # npm dependencies
├── requirements.txt # Python dependencies
├── test-published-sdk.ts # TypeScript integration test
├── test_published_sdk.py # Python integration test
└── README.md # Setup and usage instructions
Test Workflow
Both scripts perform the same workflow:
- Generate Test Image - Creates a PNG image with current timestamp
- Register Image - Uploads and registers with Numbers Protocol API
- Update Metadata - Updates the asset's headline to "SDK Test v0.2.0"
- Verify Engine Search - Searches for the asset by NID
- Get Asset Tree - Retrieves provenance data
How to Run
Prerequisites
export CAPTURE_TOKEN=your_token_hereTypeScript
cd integration-tests
npm install
npm run test:tsPython
cd integration-tests
pip install -r requirements.txt
python test_published_sdk.pyTest Results (2026-01-30)
TypeScript SDK (@numbersprotocol/capture-sdk@0.2.0)
| Step | Status | Details |
|---|---|---|
| Generate Image | ✅ PASS | test-image-1769772200385.png (7655 bytes) |
| Register | ✅ PASS | NID: bafkreigja7va5vhvqhbloxfr2tnypydvsyud4gfu7hspyyp72fsfejmkui |
| Update Headline | ✅ PASS | Set to "SDK Test v0.2.0" |
| Verify Engine | API backend issue (see note below) | |
| Asset Tree | ✅ PASS | Retrieved asset CID |
Python SDK (numbersprotocol-capture-sdk==0.2.0)
| Step | Status | Details |
|---|---|---|
| Generate Image | ✅ PASS | test-image-1769772326.png (4622 bytes) |
| Register | ✅ PASS | NID: bafkreicsw2vy4dn4grk6qpcsmblrllojp7ylc25kibru2pdy6ryl4su6iy |
| Update Headline | ✅ PASS | Set to "SDK Test v0.2.0" |
| Verify Engine | API backend issue (see note below) | |
| Asset Tree | ✅ PASS | Pending blockchain confirmation (expected) |
Note on Verify Engine
The searchAsset API returned "Authentication credentials were not provided." This appears to be a backend API issue, not an SDK problem. The SDK correctly sends the token in the form data as per the API specification:
const formData = new FormData()
formData.append('token', this.token)The core SDK functionality (register, update, get, getAssetTree) works correctly. The verify engine search is a non-critical feature that may require backend investigation.
Conclusion
✅ Both published SDK packages (v0.2.0) are working correctly for the core functionality:
- Asset registration
- Metadata updates
- Asset retrieval
- Asset tree/provenance data
The integration tests provide a reliable way to verify future releases.