mirror of
https://github.com/Akkudoktor-EOS/EOS.git
synced 2026-10-29 09:11:57 +00:00
test: consolidate suites and remove redundant cases (#1459)
Regression tests were scattered across feature- and bug-specific files, and some suites repeated the same checks. Group tests by responsibility, isolate feature fixtures in test classes, and remove duplicate or obsolete cases. The review covered all 127 collected test modules on main. This reduces them and removes or combines definitions:. No application code changes.
This commit is contained in:
@@ -8,6 +8,7 @@ from akkudoktoreos.devices.genetic.battery import (
|
||||
SolarPanelBatteryParameters,
|
||||
)
|
||||
from akkudoktoreos.devices.genetic.inverter import Inverter, InverterParameters
|
||||
from akkudoktoreos.devices.settings.invertersettings import InverterCommonSettings
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
@@ -487,3 +488,13 @@ def test_process_energy_zero_generation_full_battery_high_consumption(inverter,
|
||||
mock_battery.charge_energy.assert_not_called()
|
||||
mock_battery.discharge_energy.assert_called_once_with(500.0, hour)
|
||||
inverter.self_consumption_predictor.calculate_expected_direct_consumption.assert_not_called()
|
||||
|
||||
|
||||
class TestInverterSettings:
|
||||
@pytest.mark.parametrize("converter", ["to_genetic_param", "to_genetic0_param"])
|
||||
def test_inverter_conversion_requires_output_limit(self, converter):
|
||||
settings = InverterCommonSettings(device_id="inverter")
|
||||
with pytest.raises(ValueError, match="max_power_w"):
|
||||
getattr(settings, converter)()
|
||||
settings.max_power_w = 4200
|
||||
assert getattr(settings, converter)().max_power_wh == 4200
|
||||
|
||||
Reference in New Issue
Block a user