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)
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)
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)
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)