Overview
The SDK includes several testing utilities:- Hypothesis Strategies: Property-based testing strategies
- E2E Testing: End-to-end testing utilities
- Scale Data Generator: Generate test data at scale
- Workflow Monitoring: Monitor workflow execution in tests
Hypothesis Strategies
application_sdk.test_utils.hypothesis.strategies
Property-based testing strategies for generating test data.
Available Strategies
E2E Testing
application_sdk.test_utils.e2e
End-to-end testing utilities for workflows.
Base Test Class
Scale Data Generator
application_sdk.test_utils.scale_data_generator
Generate large-scale test data for performance testing.
DataGenerator
Workflow Monitoring
application_sdk.test_utils.workflow_monitoring
Monitor workflow execution during tests.
WorkflowMonitor
Example Usage
Basic Unit Test
Integration Test
Handler Test
Property-Based Test
Performance Test
Best Practices
Unit Testing
- Use mocks for external dependencies
- Test individual functions in isolation
- Verify both success and failure cases
- Use fixtures for common setup
Integration Testing
- Test complete workflows end-to-end
- Use real services when possible
- Clean up resources after tests
- Test error handling and recovery
Performance Testing
- Use scale data generators for realistic loads
- Measure and assert on performance metrics
- Test with production-like data volumes
- Monitor resource usage
Test Organization
- Group related tests in classes
- Use descriptive test names
- Add docstrings to tests
- Mark slow tests appropriately