Ejemplo n.º 1
0
 def testThreeLetters(self):
     """
     An argument that has three letters must result in a ValueError.
     """
     error = ("^btop string 'ABC' has a trailing query letter 'C' with no "
              "corresponding subject letter$")
     assertRaisesRegex(self, ValueError, error, list, parseBtop('ABC'))
Ejemplo n.º 2
0
 def testConsecutiveGaps(self):
     """
     An argument that has two consecutive gaps characters must result in a
     ValueError.
     """
     error = "^btop string '36--' has two consecutive gaps at offset 2$"
     assertRaisesRegex(self, ValueError, error, list, parseBtop('36--'))
Ejemplo n.º 3
0
 def testOneLetter(self):
     """
     An argument with just one letter must result in a ValueError.
     """
     error = ("^btop string 'F' has a trailing query letter 'F' with no "
              "corresponding subject letter$")
     assertRaisesRegex(self, ValueError, error, list, parseBtop('F'))
Ejemplo n.º 4
0
 def testTwoNumbersWithOneLetterBetween(self):
     """
     An argument that is a number, a single letter, and another number must
     result in a ValueError.
     """
     error = ("^btop string '36F77' has a query letter 'F' at offset 2 "
              "with no corresponding subject letter$")
     assertRaisesRegex(self, ValueError, error, list, parseBtop('36F77'))
Ejemplo n.º 5
0
 def testOneLetterThenANumber(self):
     """
     An argument that is a single letter followed by a number must result
     in a ValueError.
     """
     error = ("^btop string 'F36' has a query letter 'F' at offset 0 with "
              "no corresponding subject letter$")
     assertRaisesRegex(self, ValueError, error, list, parseBtop('F36'))
Ejemplo n.º 6
0
 def testOneNumberWithTrailingOneLetter(self):
     """
     An argument that is a number with a single letter must result in a
     ValueError.
     """
     error = ("^btop string '36F' has a trailing query letter 'F' with no "
              "corresponding subject letter$")
     assertRaisesRegex(self, ValueError, error, list, parseBtop('36F'))
Ejemplo n.º 7
0
 def testConsecutiveIdentical(self):
     """
     An argument that has two consecutive identical (non-gap) characters
     must result in a ValueError.
     """
     error = ("^btop string '36AA' has two consecutive identical 'A' "
              "letters at offset 2$")
     assertRaisesRegex(self, ValueError, error, list, parseBtop('36AA'))
Ejemplo n.º 8
0
 def testOneQuerySubjectPair(self):
     """
     An argument that is a single query/subject letter pair must give the
     expected result.
     """
     self.assertEqual([('A', 'G')], list(parseBtop('AG')))
Ejemplo n.º 9
0
 def testOneNumberWithLeadingZeroes(self):
     """
     An argument that is just one number with leading zeroes must give the
     expected result.
     """
     self.assertEqual([54], list(parseBtop('0054')))
Ejemplo n.º 10
0
 def testOneNumberThatIsZero(self):
     """
     An argument that is just the number zero must give the expected result.
     """
     self.assertEqual([0], list(parseBtop('0')))
Ejemplo n.º 11
0
 def testOneNumber(self):
     """
     An argument that is just one number must give the expected result.
     """
     self.assertEqual([54], list(parseBtop('54')))
Ejemplo n.º 12
0
 def testEmpty(self):
     """
     An empty argument must result in an empty list.
     """
     self.assertEqual([], list(parseBtop('')))
Ejemplo n.º 13
0
 def testOneQuerySubjectPairAndANumber(self):
     """
     An argument that is a single query/subject letter pair followed by a
     number must give the expected result.
     """
     self.assertEqual([('A', 'G'), 33], list(parseBtop('AG33')))
Ejemplo n.º 14
0
 def testTwoQuerySubjectPairs(self):
     """
     An argument that has two query/subject letter pairs must give the
     expected result.
     """
     self.assertEqual([('A', 'G'), ('C', 'T')], list(parseBtop('AGCT')))