Skip to content

Commit 4ccd0e6

Browse files
committed
Correct timestamps for collected_pulses()
1 parent df0dd45 commit 4ccd0e6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/test_usb.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,8 @@ def test_pulse_collection_consumption(
11221122
pulse_update_4 = fixed_this_hour + td(hours=1, minutes=1, seconds=3)
11231123
tst_consumption.update_pulse_counter(45, 0, pulse_update_4)
11241124
assert tst_consumption.log_rollover
1125-
test_timestamp = fixed_this_hour + td(hours=1, minutes=1, seconds=4)
1125+
assert tst_consumption.hourly_reset_time == pulse_update_4
1126+
test_timestamp = fixed_this_hour + td(hours=1)
11261127
assert tst_consumption.collected_pulses(
11271128
test_timestamp, is_consumption=True
11281129
) == (45, pulse_update_4)
@@ -1133,11 +1134,10 @@ def test_pulse_collection_consumption(
11331134
fixed_this_hour, is_consumption=True
11341135
) == (45 + 2222, pulse_update_4)
11351136
pulse_update_5 = fixed_this_hour + td(hours=1, minutes=1, seconds=18)
1136-
test_timestamp_2 = fixed_this_hour + td(hours=1, minutes=1, seconds=20)
11371137
tst_consumption.update_pulse_counter(145, 0, pulse_update_5)
11381138
# Test collection of the last new hour
11391139
assert tst_consumption.collected_pulses(
1140-
test_timestamp_2, is_consumption=True
1140+
test_timestamp, is_consumption=True
11411141
) == (145, pulse_update_5)
11421142

11431143
# Test log rollover by updating log first before updating pulses

0 commit comments

Comments
 (0)