Пример #1
0
 def test_simple_filter(self):
     tourn = wc_swiss.parse_tournament(simple_r1)
     wc_swiss.filter_players(tourn, 3)
     self.assertEqual(len(tourn.players), 0)
     tourn = wc_swiss.parse_tournament(simple_r5)
     wc_swiss.filter_players(tourn, 3)
     self.assertEqual(tourn.players, frozenset(["player3", "player4"]))
Пример #2
0
 def test_simple_filter(self):
     tourn = wc_swiss.parse_tournament(simple_r1)
     wc_swiss.filter_players(tourn, 3)
     self.assertEqual(len(tourn.players), 0)
     tourn = wc_swiss.parse_tournament(simple_r5)
     wc_swiss.filter_players(tourn, 3)
     self.assertEqual(tourn.players, frozenset(["player3", "player4"]))
Пример #3
0
 def test_simple_bye(self):
     for sround, spairings, sbye in simple_byes:
         tourn = wc_swiss.parse_tournament(sround)
         pairings, bye = wc_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
Пример #4
0
 def test_simple_bye(self):
     for sround, spairings, sbye in simple_byes:
         tourn = wc_swiss.parse_tournament(sround)
         pairings, bye = wc_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