コード例 #1
0
ファイル: tournamenttest.py プロジェクト: WongTai/snippets
 def testScoreSimple(self):
     """Simple scoring test with no input mask."""
     # Compute an offset near the end of the bit array since we're working
     # with small numbers.
     offset=64-8
     s, failed=tournament.score(15, 7, offset, 8, 1, [])
     self.assertEquals(s, 7) # Of eight bits, only one was different
     self.assertEquals(len(failed), 1)
     self.assertTrue(1 in failed)
コード例 #2
0
ファイル: tournamenttest.py プロジェクト: ktosiu/snippets-2
 def testScoreSimple(self):
     """Simple scoring test with no input mask."""
     # Compute an offset near the end of the bit array since we're working
     # with small numbers.
     offset = 64 - 8
     s, failed = tournament.score(15, 7, offset, 8, 1, [])
     self.assertEquals(s, 7)  # Of eight bits, only one was different
     self.assertEquals(len(failed), 1)
     self.assertTrue(1 in failed)
コード例 #3
0
ファイル: tournamenttest.py プロジェクト: WongTai/snippets
 def testScoreFailureSkipping(self):
     """Scoring test skipping matches based on previous mask."""
     # Compute an offset near the end of the bit array since we're working
     # with small numbers.
     offset=64-8
     s, failed=tournament.score(15, 7, offset, 8, 1, [0, 1, 2])
     self.assertEquals(s, 4) # Scoring based on similarities minus exceptions
     self.assertEquals(len(failed), 2)
     # These were carried forward from the previous test
     self.assertTrue(0 in failed)
     self.assertTrue(1 in failed)
コード例 #4
0
ファイル: tournamenttest.py プロジェクト: ktosiu/snippets-2
 def testScoreFailureSkipping(self):
     """Scoring test skipping matches based on previous mask."""
     # Compute an offset near the end of the bit array since we're working
     # with small numbers.
     offset = 64 - 8
     s, failed = tournament.score(15, 7, offset, 8, 1, [0, 1, 2])
     self.assertEquals(s,
                       4)  # Scoring based on similarities minus exceptions
     self.assertEquals(len(failed), 2)
     # These were carried forward from the previous test
     self.assertTrue(0 in failed)
     self.assertTrue(1 in failed)