def test_simple_filter(self): tourn = wt_swiss.parse_tournament(simple_r1) wt_swiss.filter_players(tourn, 3) self.assertEqual(len(tourn.players), 0) tourn = wt_swiss.parse_tournament(simple_r5) wt_swiss.filter_players(tourn, 3) self.assertEqual(tourn.players, frozenset(["player3", "player4"]))
def test_simple_bye(self): for sround, spairings, sbye in simple_byes: tourn = wt_swiss.parse_tournament(sround) pairings, bye = wt_swiss.get_pairings(tourn) pairings = [sorted(p) for p in pairings] pairings.sort() try: self.assertEqual(pairings, spairings) self.assertEqual(bye, sbye) except AssertionError: print "Pairing error found for simple bye:" print sround raise