Skip to content

Extend functions#2

Open
remcom wants to merge 12 commits into
masterfrom
extend-functions
Open

Extend functions#2
remcom wants to merge 12 commits into
masterfrom
extend-functions

Conversation

@remcom

@remcom remcom commented Apr 7, 2026

Copy link
Copy Markdown
Owner

No description provided.

remcom and others added 12 commits April 6, 2026 21:48
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add 8 comprehensive test cases for the _validate_phases validator function
that will be implemented in Task 2. Tests cover:

- Single-phase (phases:1) validation:
  - Requires ac_voltage
  - Rejects ac_voltage_a, ac_voltage_b, ac_voltage_c

- Three-phase (phases:3) validation:
  - Requires all three ac_voltage_a, ac_voltage_b, ac_voltage_c
  - Rejects single-phase ac_voltage
  - Optional currents (all three or none)
  - Rejects partial current sets

Tests use a helper function _make_base_config() to build minimal valid
configs, reducing boilerplate. Tests are expected to fail with ImportError
until the constants and _validate_phases function are defined.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move sys.path.insert block to top of file, immediately after imports
- Add missing test for phases:3 rejecting single-phase ac_current sensor
- Fixes issue where sys.path manipulation was mid-file instead of adjacent to imports
- Adds test coverage for _validate_phases rejecting ac_current in 3-phase config

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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