mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-25 04:15:45 -08:00
* Use functions to structure code * Remove 1-line function * Use dataclass * Replace dictionaries by a list
14 lines
284 B
Python
14 lines
284 B
Python
import io
|
|
|
|
from _pytest.monkeypatch import MonkeyPatch
|
|
from bullseye import main
|
|
|
|
|
|
def test_main(monkeypatch: MonkeyPatch) -> None:
|
|
nb_players = 1
|
|
monkeypatch.setattr(
|
|
"sys.stdin",
|
|
io.StringIO(f"{nb_players}\nMartin\n3\n2\n1" + ("\n2" * 21)),
|
|
)
|
|
main()
|