diff options
Diffstat (limited to 'src/match_up/tests/__init__.py')
| -rw-r--r-- | src/match_up/tests/__init__.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/match_up/tests/__init__.py b/src/match_up/tests/__init__.py new file mode 100644 index 0000000..0a2bd15 --- /dev/null +++ b/src/match_up/tests/__init__.py @@ -0,0 +1,16 @@ +from os import remove +from pathlib import PurePath +from names import get_first_name, get_last_name +from match_up.model import Player, PlayerDatabase + +TEST_DATABASE_LOCATION = PurePath("test_storage.json") + + +def generate_test_database(total_players: int = 10) -> None: + p = PlayerDatabase(TEST_DATABASE_LOCATION) + for _ in range(total_players): + p.add_player(Player(first_name=get_first_name(), last_name=get_last_name())) + + +def remove_test_database() -> None: + remove(TEST_DATABASE_LOCATION) |
