Files
basic-computer-games/18_Bullseye/python/test_bullseye.py
Martin Thoma f7bf099152 Bullseye (Python): Refactoring
* Use functions to structure code
* Remove 1-line function
* Use dataclass
* Replace dictionaries by a list
2022-03-26 07:05:40 +01:00

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()