Skip to content

Add end-to-end integration test for Python SDK #7

@sunilp

Description

@sunilp

Summary

The Python SDK has 29 unit tests for types and routing logic, but no end-to-end test that spins up an actual delegate and client talking over HTTP.

What to do

  1. Create sdk/python/tests/test_integration.py
  2. Implement a test delegate using LdpDelegate
  3. Start it on a random port (use uvicorn programmatically or a test fixture)
  4. Use LdpClient to discover, establish session, and submit a task
  5. Verify the response includes correct output and provenance

Why this matters

Without integration tests, we can't catch issues in the HTTP layer, session handshake, or serialization between client and delegate. This is the most important test gap in the SDK.

Hints

  • Look at tests/ldp_integration.rs in the Rust crate for the pattern (it does exactly this)
  • Use pytest-asyncio for async test support
  • Start uvicorn in a background thread or use httpx.ASGITransport to test without a real server

Acceptance criteria

  • At least 3 integration tests: discover, submit_task, trust domain rejection
  • Tests pass with pytest sdk/python/tests/test_integration.py
  • No external dependencies beyond what's in pyproject.toml[dev]

Metadata

Metadata

Assignees

No one assigned

    Labels

    sdkSDK implementations (Python, TypeScript, Go)testingTest coverage and conformance

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions