def test_sm_import_and_export():
    test_sm_export_filepath = Path(__file__).parent / 'poznan/poznan.re'
    tour = Tournament('Poznań 2018', 'GW', 'Poznań')
    tour.read_from_scrabble_manager(test_sm_export_filepath)
    with TemporaryDirectory() as tmpdir:
        tour.export_t(Path(tmpdir) / 'test_a.t')
        new_tour = Tournament('Poznań 2018', 'GW', 'Poznań')
        new_tour.read_from_t(Path(tmpdir) / 'test_a.t')
        new_tour.export_re(Path(tmpdir) / 'test_re.re')
        assert cmp(test_sm_export_filepath, Path(tmpdir) / 'test_re.re')
Exemple #2
0
from pathlib import Path

from tournament import Tournament
from reader import read_re, read_lte


tour = Tournament('Mistrzostwa TSH', 'Adam Kłimónt', 'Cambridge')
tour.read_from_t('/home/adam/code/tsh/samplepl/a.t')
tour.export_re('/home/adam/Downloads/test.re')
tour.export_tin('/home/adam/Downloads/test.tin')
tour.export_lte('/home/adam/Downloads/test.lte')
tour.export_nag('/home/adam/Downloads/test.nag')
tour.export_smt('/home/adam/Downloads/test.smt')
# games = tour.get_players_games(8)

# print(games)
# # for g in tour.games:
# #     print(g)
# for p in tour.players:
#     print(p)

newtour = Tournament('Poznań', 'Grzegorz', 'Poznań')
newtour.read_from_scrabble_manager('/home/adam/Downloads/turnieje/Documents/kolobrzeg/kolobrzeg.re')

for r in range(9, 12):
    newtour.export_t(f'/home/adam/code/tsh/samplekolobrzeg/a.t_{r}', last_round=r)

newtour = Tournament('Poznań', 'Grzegorz', 'Poznań')
newtour.read_from_scrabble_manager('/home/adam/Downloads/turnieje/Documents/jaworzno/jaworzno.re')
for r in range(9, 12):
    newtour.export_t(f'/home/adam/code/tsh/samplekonojady2018/a.t_{r}', last_round=r)