aboutsummaryrefslogtreecommitdiff
path: root/src/match_up/tests
diff options
context:
space:
mode:
authorKaran Jayachandra <karan.jayachandra@nxp.com>2024-04-04 17:06:26 +0200
committerKaran Jayachandra <karan.jayachandra@nxp.com>2024-04-04 17:06:26 +0200
commit5c919160e3c6c3476f7ffc760a16c279b93891bd (patch)
tree28a2e504844eac857380f0dfafc65ba36f2cab28 /src/match_up/tests
parent93107be91806cc7bf35b33d090d185c988fafda7 (diff)
First useful code
Diffstat (limited to 'src/match_up/tests')
-rw-r--r--src/match_up/tests/__init__.py16
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)