44Integration tests for the Power Monitor component.
55"""
66
7- from datetime import datetime
87import time
8+ from datetime import datetime
99
1010import pytest
1111from common import proves_send_and_assert_command
@@ -50,6 +50,7 @@ def test_01_power_manager_telemetry(fprime_test_api: IntegrationTestAPI, start_g
5050 f"{ ina219SolManager } .Power" , start = start , timeout = 65
5151 )
5252
53+ # TODO: Fix the power readings once INA219 power calculation is verified
5354 sys_voltage_reading : dict [float ] = sys_voltage .get_val ()
5455 sys_current_reading : dict [float ] = sys_current .get_val ()
5556 # sys_power_reading: dict[float] = sys_power.get_val()
@@ -75,8 +76,8 @@ def test_02_total_power_consumption_telemetry(
7576
7677 total_power_reading : float = total_power .get_val ()
7778
78- # Total power should be non-negative (accumulating over time)
79- assert total_power_reading > = 0 , "Total power consumption should be non-negative "
79+ # Total power should be non-zero (accumulating over time)
80+ assert total_power_reading ! = 0 , "Total power consumption should be non-zero "
8081
8182
8283def test_03_reset_total_power_command (fprime_test_api : IntegrationTestAPI , start_gds ):
@@ -92,17 +93,15 @@ def test_03_reset_total_power_command(fprime_test_api: IntegrationTestAPI, start
9293 )
9394
9495 # Verify event was logged
95- fprime_test_api .assert_event (
96- f"{ powerMonitor } .TotalPowerReset" , start = "NOW" , timeout = 3
97- )
96+ fprime_test_api .assert_event (f"{ powerMonitor } .TotalPowerReset" , timeout = 3 )
9897
9998 # Wait for next telemetry update
10099 time .sleep (2 )
101100
102101 # Get total power after reset - should be very small (close to 0)
103102 # Allow small value due to time between reset and next telemetry update
104103 total_power_after : ChData = fprime_test_api .assert_telemetry (
105- f"{ powerMonitor } .TotalPowerConsumption" , start = "NOW" , timeout = 3
104+ f"{ powerMonitor } .TotalPowerConsumption" , timeout = 3
106105 )
107106
108107 total_power_after_reading : float = total_power_after .get_val ()
0 commit comments