def test_getLastWord(self): self.assertEqual(align.getLastWord(self.A), align.intsToWord(self.A)) self.assertEqual(align.getLastWord(self.D), align.intsToWord(self.D)) self.assertEqual(align.getLastWord(self.E), align.intsToWord(self.A)) self.assertEqual(align.getLastWord(self.F), align.intsToWord(self.B)) self.assertEqual(align.getLastWord(self.G), align.intsToWord([3, 0, 2, 3, 3, 3, 3]))
def test_getFirstWord(self): self.assertEqual(align.getFirstWord(self.A), align.intsToWord(self.A)) self.assertEqual(align.getFirstWord(self.D), align.intsToWord(self.D)) self.assertEqual(align.getFirstWord(self.E), align.intsToWord(self.A)) self.assertEqual(align.getFirstWord(self.F), align.intsToWord(self.B)) self.assertEqual(align.getFirstWord(self.G), align.intsToWord([1, 3, 1, 1, 3, 2, 1]))
def test_getWordByIndex(self): self.assertEqual(align.getWordByIndex(self.D, 0), align.intsToWord(self.D)) self.assertEqual(align.getWordByIndex(self.G, 0), align.getFirstWord(self.G)) self.assertEqual(align.getWordByIndex(self.G, 500 - 7), align.getLastWord(self.G)) self.assertEqual(align.getWordByIndex(self.G, 2), align.intsToWord([1, 1, 3, 2, 1, 1, 1]))
def test_getAllWords_asList(self): self.assertEqual(align.getAllWords_asList(self.A), [align.intsToWord(self.A)]) self.assertEqual(align.getAllWords_asList(self.A + [0]), [align.intsToWord(self.A), align.intsToWord(self.A)]) h = [ align.intsToWord(self.H[0:7]), align.intsToWord(self.H[1:8]), align.intsToWord(self.H[2:9]) ] self.assertEqual(align.getAllWords_asList(self.H), h) g = align.getAllWords_asList(self.G) for i in range(len(g)): self.assertEqual(g[i], align.getWordByIndex(self.G, i))
def test_intsToWord(self): self.assertEqual(align.intsToWord(self.A), 0) self.assertEqual(align.intsToWord(self.B), 5461) self.assertEqual(align.intsToWord(self.C), 12601) self.assertEqual(align.intsToWord(self.D), 12071)