@@ -874,8 +874,7 @@ def test_idle_skip_long_before_long(
874874 """Test idling for longer than long break time, right before the next long
875875 break.
876876
877- FIXME: this test is broken, it should not work this way. Instead of just
878- skipping the long break, it skips all the short breaks too.
877+ This used to skip all the short breaks too.
879878 """
880879 context : dict [str , typing .Any ] = {
881880 "session" : {},
@@ -986,29 +985,58 @@ def test_idle_skip_long_before_long(
986985 sequential_threading_handle ,
987986 safe_eyes_core ,
988987 context ,
989- long_break_duration ,
990- "translated!: long break 1" ,
988+ short_break_duration ,
989+ "translated!: break 1" ,
991990 )
992991
993- # Time passed: 16min 10s
994- # 15min short_break_interval (from previous, as long_break_interval must be
995- # multiple)
996- # 10 seconds pre_break_warning_time, 1 minute long_break_duration
997- self .assert_datetime ("2024-08-25T15:18:55" )
992+ self .assert_datetime ("2024-08-25T14:18:10" )
998993
999994 self .run_next_break (
1000995 sequential_threading_handle ,
1001996 time_machine ,
1002997 safe_eyes_core ,
1003998 context ,
1004999 short_break_duration ,
1005- "translated!: break 1 " ,
1000+ "translated!: break 2 " ,
10061001 )
10071002
1008- # Time passed: 15min 25s
1009- # 15min short_break_interval, 10 seconds pre_break_warning_time,
1010- # 15 seconds short_break_duration
1011- self .assert_datetime ("2024-08-25T15:34:20" )
1003+ self .assert_datetime ("2024-08-25T14:33:35" )
1004+
1005+ self .run_next_break (
1006+ sequential_threading_handle ,
1007+ time_machine ,
1008+ safe_eyes_core ,
1009+ context ,
1010+ short_break_duration ,
1011+ "translated!: break 3" ,
1012+ )
1013+
1014+ self .assert_datetime ("2024-08-25T14:49:00" )
1015+
1016+ self .run_next_break (
1017+ sequential_threading_handle ,
1018+ time_machine ,
1019+ safe_eyes_core ,
1020+ context ,
1021+ short_break_duration ,
1022+ "translated!: break 4" ,
1023+ )
1024+
1025+ self .assert_datetime ("2024-08-25T15:04:25" )
1026+
1027+ # note that long break 1 was skipped, and we went directly to long break 2
1028+ # there's a note in BreakQueue.skip_long_break, we could fix it if needed, but
1029+ # it seems too much effort to be worth it right now
1030+ self .run_next_break (
1031+ sequential_threading_handle ,
1032+ time_machine ,
1033+ safe_eyes_core ,
1034+ context ,
1035+ long_break_duration ,
1036+ "translated!: long break 2" ,
1037+ )
1038+
1039+ self .assert_datetime ("2024-08-25T15:20:35" )
10121040
10131041 safe_eyes_core .stop ()
10141042
0 commit comments