blob: 7b30c1b64bda0cca67a345c9d54403fd0a467a9d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
from pathlib import PurePath
from time import sleep
from match_up.model import PlayerDatabase
from match_up.tests import generate_test_database, remove_test_database
class PlaySession:
def __init__(self, database_location: PurePath):
self.data = PlayerDatabase(database_location)
def main():
generate_test_database()
s = PlaySession(PurePath("test_storage.json"))
for player in s.data.get_players():
print(player)
sleep(2)
s.data._database.close()
remove_test_database()
|