mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-31 15:07:42 -08:00
Bullseye (Python): Refactoring
* Use functions to structure code * Remove 1-line function * Use dataclass * Replace dictionaries by a list
This commit is contained in:
13
18_Bullseye/python/test_bullseye.py
Normal file
13
18_Bullseye/python/test_bullseye.py
Normal file
@@ -0,0 +1,13 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user