Skip to content

feat: Add comprehensive test suite with 94% coverage#1

Merged
dbhurley merged 1 commit into
mainfrom
feature/issue-6-test-suite
Feb 18, 2026
Merged

feat: Add comprehensive test suite with 94% coverage#1
dbhurley merged 1 commit into
mainfrom
feature/issue-6-test-suite

Conversation

@dbhurley

Copy link
Copy Markdown
Collaborator

Summary

Implements Issue #6 - Python SDK Test Suite

Changes

Test Files Added

  • tests/conftest.py - Shared fixtures for mocking HTTP responses
  • tests/test_client.py - Client initialization, headers, health checks, dataclasses (32 tests)
  • tests/test_policy.py - Policy check, enforce, govern context manager (12 tests)
  • tests/test_errors.py - Exception classes and HTTP error handling (15 tests)
  • tests/test_admin.py - Admin operations (agents, policies, audit log) (11 tests)
  • tests/test_proxy.py - Proxy request methods (8 tests)
  • tests/test_langchain.py - LangChain integration (decorators, wrappers, toolkit) (15 tests)

Configuration

  • pytest + pytest-asyncio + pytest-cov configured in pyproject.toml
  • CI workflow updated to run tests with coverage on Python 3.9-3.12
  • Codecov integration for coverage reporting
  • Added CI status badge to README
  • Added .gitignore for Python artifacts

Test Coverage

Overall: 94% (218 statements, 14 missed)

File Coverage
meshguard/init.py 100%
meshguard/client.py 98%
meshguard/exceptions.py 100%
meshguard/langchain.py 82%

Acceptance Criteria

  • Test coverage >80% for core client ✅ (94%)
  • Unit tests with mocked HTTP responses
  • pytest + pytest-asyncio configured
  • Tests run in CI (GitHub Actions)
  • README badge showing test status

Closes #6

Implements Issue #6 - Python SDK Test Suite

Tests added:
- test_client.py: Client initialization, headers, health checks, dataclasses
- test_policy.py: Policy check, enforce, govern context manager
- test_errors.py: Exception classes and HTTP error handling
- test_admin.py: Admin operations (agents, policies, audit log)
- test_proxy.py: Proxy request methods
- test_langchain.py: LangChain integration (decorators, wrappers, toolkit)

Configuration:
- pytest + pytest-asyncio + pytest-cov configured
- CI updated to run tests with coverage on Python 3.9-3.12
- Codecov integration for coverage reporting
- Added test status badge to README
- Added .gitignore for Python artifacts

Coverage: 94% (218 statements, 14 missed)
- meshguard/__init__.py: 100%
- meshguard/client.py: 98%
- meshguard/exceptions.py: 100%
- meshguard/langchain.py: 82%

Closes #6
@dbhurley
dbhurley merged commit b9cedf8 into main Feb 18, 2026
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant