@@ -1127,14 +1127,14 @@ def test_pulse_collection_consumption(
11271127 test_timestamp , is_consumption = True
11281128 ) == (45 , pulse_update_4 )
11291129 tst_consumption .add_log (100 , 2 , (fixed_this_hour + td (hours = 1 )), 2222 )
1130- assert not tst_consumption .log_rollover
1130+ assert tst_consumption .log_rollover
11311131 # Test collection of the last full hour
11321132 assert tst_consumption .collected_pulses (
11331133 fixed_this_hour , is_consumption = True
1134- ) == (45 + 2222 , pulse_update_3 )
1134+ ) == (45 + 2222 , pulse_update_4 )
11351135 pulse_update_5 = fixed_this_hour + td (hours = 1 , minutes = 1 , seconds = 18 )
11361136 test_timestamp_2 = fixed_this_hour + td (hours = 1 , minutes = 1 , seconds = 20 )
1137- tst_consumption .update_pulse_counter (145 , 0 , pulse_update_4 )
1137+ tst_consumption .update_pulse_counter (145 , 0 , pulse_update_5 )
11381138 # Test collection of the last new hour
11391139 assert tst_consumption .collected_pulses (
11401140 test_timestamp_2 , is_consumption = True
@@ -1146,17 +1146,17 @@ def test_pulse_collection_consumption(
11461146
11471147
11481148 # Test log rollover by updating log first before updating pulses
1149- tst_consumption .add_log (100 , 3 , (fixed_this_hour + td (hours = 3 )), 3333 )
1149+ tst_consumption .add_log (100 , 3 , (fixed_this_hour + td (hours = 2 )), 3333 )
11501150 assert tst_consumption .log_rollover
11511151 assert tst_consumption .collected_pulses (
11521152 fixed_this_hour , is_consumption = True
1153- ) == (145 + 2222 + 3333 , pulse_update_4 )
1154- pulse_update_5 = fixed_this_hour + td (hours = 3 , seconds = 10 )
1155- tst_consumption .update_pulse_counter (321 , 0 , pulse_update_5 )
1156- assert not tst_consumption .log_rollover
1153+ ) == (145 + 2222 + 3333 , pulse_update_5 )
1154+ pulse_update_6 = fixed_this_hour + td (hours = 2 , seconds = 10 )
1155+ tst_consumption .update_pulse_counter (321 , 0 , pulse_update_6 )
1156+ assert tst_consumption .log_rollover
11571157 assert tst_consumption .collected_pulses (
11581158 fixed_this_hour , is_consumption = True
1159- ) == (2222 + 3333 + 321 , pulse_update_5 )
1159+ ) == (2222 + 3333 + 321 , pulse_update_6 )
11601160
11611161 # Test next midnight rollover
11621162 #pulse_update_6 = fixed_this_hour.replace(hour=0, minute=0, second=3) + td(days=1)
0 commit comments