Add show_round, ask_choice and play_game with injectable input and output, and make python -m higher_lower play a game. Each account is shown once per game; a wrong guess or running out of accounts ends it. Invalid input is re-asked. Ctrl+C and Ctrl+D leave with a goodbye. Cover the loop with scripted tests (36 passing). Task: MIL-003#1 Task: MIL-003#2 Task: MIL-003#3 Task: MIL-003#4 Task: MIL-003#5 Closes #12 Closes #13 Closes #14 Closes #15 Closes #16
17 lines
455 B
Python
17 lines
455 B
Python
"""@file test_smoke.py
|
|
@brief Smoke test: the package and its entry point can be imported.
|
|
"""
|
|
|
|
import higher_lower
|
|
from higher_lower import __main__ as entry_point
|
|
|
|
|
|
def test_package_imports() -> None:
|
|
"""@brief The package imports without side effects."""
|
|
assert higher_lower.__doc__
|
|
|
|
|
|
def test_entry_point_is_callable() -> None:
|
|
"""@brief The entry point exists; importing it does not start a game."""
|
|
assert callable(entry_point.main)
|