aboutsummaryrefslogtreecommitdiff
path: root/src/match_up/tests
diff options
context:
space:
mode:
authorKaran Jayachandra <mail@karanjayachandra.com>2024-10-14 08:51:59 +0000
committerKaran Jayachandra <mail@karanjayachandra.com>2024-10-14 08:51:59 +0000
commiteac95cc2e259badf3a8c3309e6e7be97d5cbd868 (patch)
tree492b1497cf648e08e84a35dea2d217a57643dab0 /src/match_up/tests
parent2b264abdf62822936e3510b0f9690ba1e359a9b8 (diff)
parentf80463a6437533deef1d85ffa31cf0cc5ed8e454 (diff)
Merge branch 'pure' into 'develop'
Dash to Flask HTML Conversion See merge request KaranJayachandra/match_up!1
Diffstat (limited to 'src/match_up/tests')
-rw-r--r--src/match_up/tests/__init__.py44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/match_up/tests/__init__.py b/src/match_up/tests/__init__.py
deleted file mode 100644
index 3166746..0000000
--- a/src/match_up/tests/__init__.py
+++ /dev/null
@@ -1,44 +0,0 @@
-from os import remove
-from os.path import isfile
-from random import randint
-from pathlib import PurePath
-from names import get_first_name, get_last_name
-from match_up.model import Player, PlayerDatabase, MIN_SKILL, MAX_SKILL
-
-TEST_DATABASE_LOCATION = PurePath("test_storage.json")
-
-
-def generate_test_database(total_players: int = 20) -> None:
- try:
- if isfile(TEST_DATABASE_LOCATION):
- remove(TEST_DATABASE_LOCATION)
- db = PlayerDatabase(TEST_DATABASE_LOCATION)
- for _ in range(total_players):
- db.add_player(
- Player(
- first_name=get_first_name(),
- last_name=get_last_name(),
- skill=randint(MIN_SKILL, MAX_SKILL),
- )
- )
- finally:
- db.close()
-
-
-def activate_random_players(activate_players: int = 17) -> None:
- try:
- db = PlayerDatabase(TEST_DATABASE_LOCATION)
- player_list = db.get_players()
- for index, player in enumerate(player_list):
- if index < activate_players:
- db.activate_player(player)
- finally:
- db.close()
-
-
-def main():
- pass
-
-
-if __name__ == "__main__":
- main()