Skip to content

Commit

Permalink
For test robustness stagger onbatt and lowbattery
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeagherix committed Aug 30, 2024
1 parent d5dfef4 commit 956b96d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/api2/test_530_ups.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,11 @@ def test__ups_onbatt_to_online(ups_running, dummy_ups_driver_configured):

def test__ups_online_to_onbatt_lowbattery(ups_running, dummy_ups_driver_configured):
assert 'UPSOnBattery' not in [alert['klass'] for alert in call('alert.list')]
write_fake_data({'battery.charge': 10, 'ups.status': 'OB LB'})
write_fake_data({'battery.charge': 90, 'ups.status': 'OB'})
alert = wait_for_alert('UPSOnBattery')
assert alert
assert 'battery.charge: 10' in alert['formatted'], alert
assert 'battery.charge: 90' in alert['formatted'], alert
write_fake_data({'battery.charge': 10, 'ups.status': 'OB LB'})
alert = wait_for_alert('UPSBatteryLow')
assert alert
assert 'battery.charge: 10' in alert['formatted'], alert
Expand Down

0 comments on commit 956b96d

Please sign in to comment.