|
@@ 15-29 (lines=15) @@
|
| 12 |
|
return timer |
| 13 |
|
|
| 14 |
|
|
| 15 |
|
def test_timer_prerace(random_users): |
| 16 |
|
timer = get_test_timer() |
| 17 |
|
race = get_test_race( |
| 18 |
|
status_value="open", version=12, |
| 19 |
|
started_at=None, start_delay=timedelta(seconds=15, microseconds=1), |
| 20 |
|
entrants=get_test_entrants(random_users) |
| 21 |
|
) |
| 22 |
|
color, text = timer.get_timer_text(race, "") |
| 23 |
|
assert color is None |
| 24 |
|
assert text == "-0:00:15.0" |
| 25 |
|
|
| 26 |
|
timer.use_podium_colors = True |
| 27 |
|
color, text = timer.get_timer_text(race, "") |
| 28 |
|
assert color is timer.pre_color |
| 29 |
|
assert text == "-0:00:15.0" |
| 30 |
|
|
| 31 |
|
|
| 32 |
|
def test_timer_counting_down(random_users): |
|
@@ 32-45 (lines=14) @@
|
| 29 |
|
assert text == "-0:00:15.0" |
| 30 |
|
|
| 31 |
|
|
| 32 |
|
def test_timer_counting_down(random_users): |
| 33 |
|
timer = get_test_timer() |
| 34 |
|
race = get_test_race( |
| 35 |
|
status_value="pending", version=13, started_at=time_ago(seconds=-5.01), |
| 36 |
|
start_delay=timedelta(seconds=15.0), |
| 37 |
|
entrants=get_test_entrants(random_users) |
| 38 |
|
) |
| 39 |
|
color, text = timer.get_timer_text(race, "") |
| 40 |
|
assert color is None |
| 41 |
|
assert text == "-0:00:05.0" |
| 42 |
|
|
| 43 |
|
timer.use_podium_colors = True |
| 44 |
|
color, text = timer.get_timer_text(race, "") |
| 45 |
|
assert color is timer.pre_color |
| 46 |
|
|
| 47 |
|
|
| 48 |
|
def test_timer_midrace_no_entrant(random_users): |