aboutsummaryrefslogtreecommitdiff
path: root/src/match_up/tests/__init__.py
blob: 0a2bd15c151db56019c7a3dfb1dc8b4983f891e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)