Bullseye (Python): Refactoring

* Use functions to structure code
* Remove 1-line function
* Use dataclass
* Replace dictionaries by a list
This commit is contained in:
Martin Thoma
2022-03-26 07:05:40 +01:00
parent 0e3aecccfa
commit f7bf099152
3 changed files with 123 additions and 122 deletions

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