Parent Issue: #4 Zero Test Coverage
Objective
Create comprehensive unit tests for the RiverLinkApiClient class covering connection management, command execution, and error handling.
Test Coverage Areas
Connection Tests
Command Tests
API Method Tests
Error Handling Tests
Mock Strategy
# Mock asyncio.open_connection
@pytest.fixture
def mock_connection():
reader = AsyncMock(spec=asyncio.StreamReader)
writer = AsyncMock(spec=asyncio.StreamWriter)
return reader, writer
Target Coverage
- Goal: 90%+ line coverage for api.py
- Focus: Critical paths and error scenarios
References
Priority
🔴 High - Core functionality
Parent Issue: #4 Zero Test Coverage
Objective
Create comprehensive unit tests for the RiverLinkApiClient class covering connection management, command execution, and error handling.
Test Coverage Areas
Connection Tests
Command Tests
API Method Tests
Error Handling Tests
Mock Strategy
Target Coverage
References
custom_components/riverlink/api.pyPriority
🔴 High - Core functionality