|
@@ 81-96 (lines=16) @@
|
| 78 |
|
assert color == timer.racing_color |
| 79 |
|
|
| 80 |
|
|
| 81 |
|
def test_timer_midrace_w_user_not_in_race(random_users): |
| 82 |
|
started_at = ( |
| 83 |
|
datetime.now(timezone.utc) - |
| 84 |
|
timedelta(hours=1, minutes=42, seconds=42.0) |
| 85 |
|
) |
| 86 |
|
race = get_test_race( |
| 87 |
|
version=17, entrants=get_test_entrants(random_users), |
| 88 |
|
started_at=started_at |
| 89 |
|
) |
| 90 |
|
timer = get_test_timer() |
| 91 |
|
color, text = timer.get_timer_text(race, "user_not_in_race#6969") |
| 92 |
|
assert color is None |
| 93 |
|
assert text == "1:42:42.0" |
| 94 |
|
timer.use_podium_colors = True |
| 95 |
|
color, text = timer.get_timer_text(race, "user_not_in_race#6969") |
| 96 |
|
assert color == timer.racing_color |
| 97 |
|
|
| 98 |
|
|
| 99 |
|
def test_timer_race_cancelled(random_users): |
|
@@ 48-61 (lines=14) @@
|
| 45 |
|
assert color is timer.pre_color |
| 46 |
|
|
| 47 |
|
|
| 48 |
|
def test_timer_midrace_no_entrant(random_users): |
| 49 |
|
timer = get_test_timer() |
| 50 |
|
race = get_test_race( |
| 51 |
|
status_value="in_progress", version=15, entrants_count=2, |
| 52 |
|
started_at=datetime.now(timezone.utc)-timedelta(hours=1, minutes=20), |
| 53 |
|
entrants=get_test_entrants(random_users) |
| 54 |
|
) |
| 55 |
|
color, text = timer.get_timer_text(race, "") |
| 56 |
|
assert color is None |
| 57 |
|
# hope this always runs in less than 0.1 seconds XD |
| 58 |
|
assert text == "1:20:00.0" |
| 59 |
|
timer.use_podium_colors = True |
| 60 |
|
color, text = timer.get_timer_text(race, "") |
| 61 |
|
assert color is timer.racing_color |
| 62 |
|
|
| 63 |
|
|
| 64 |
|
def test_timer_midrace_w_entrant(random_users): |