Result parsing and formatting, one stdout result line, elapsed time, handling of stale elements and of clicks blocked by the cookie banner (found in real container runs), the baseline result and the screenshot of lecture step 4. Code review RC-017. Closes #22 Closes #23 Closes #24 Closes #25 Task: MIL-005#1 Task: MIL-005#2 Task: MIL-005#3 Task: MIL-005#4
21 lines
508 B
Python
21 lines
508 B
Python
"""@file test_report.py
|
|
@brief Tests of the result line.
|
|
"""
|
|
|
|
import pytest
|
|
|
|
from cookie_clicker_bot.application.report import format_result
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
("value", "expected"),
|
|
[
|
|
(8.5, "cookies/second: 8.5"),
|
|
(0.0, "cookies/second: 0"),
|
|
(1234.5, "cookies/second: 1234.5"),
|
|
(1_200_000.0, "cookies/second: 1200000"),
|
|
],
|
|
)
|
|
def test_format_result_writes_the_summary_line(value: float, expected: str) -> None:
|
|
assert format_result(value) == expected
|