feat: Add comprehensive test suite with 94% coverage#1
Merged
Conversation
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
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
Implements Issue #6 - Python SDK Test Suite
Changes
Test Files Added
tests/conftest.py- Shared fixtures for mocking HTTP responsestests/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
pyproject.toml.gitignorefor Python artifactsTest Coverage
Overall: 94% (218 statements, 14 missed)
Acceptance Criteria
Closes #6