Skip to content

[Sub] Set up Test Infrastructure with pytest-homeassistant-custom-component #14

Description

@switch180

Parent Issue: #4 Zero Test Coverage

Objective

Set up the foundational test infrastructure using pytest-homeassistant-custom-component to enable automated testing of the RiverLink integration.

Tasks

  • Add pytest-homeassistant-custom-component to requirements.txt
  • Create tests/ directory structure
  • Set up conftest.py with common fixtures
  • Configure pytest.ini or pyproject.toml
  • Create fixture files for mock API responses
  • Add pytest to CI/CD workflow
  • Document test execution in CONTRIBUTING.md

Directory Structure

tests/
├── __init__.py
├── conftest.py           # Pytest fixtures
├── test_api.py           # API client tests
├── test_coordinator.py   # Coordinator tests
├── test_config_flow.py   # Config flow tests
├── test_sensor.py        # Sensor platform tests
├── test_binary_sensor.py # Binary sensor tests
├── test_select.py        # Select platform tests
└── fixtures/
    └── api_responses.json  # Mock API responses

References

Priority

🔴 High - Foundation for all other testing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions