Beispiel #1
0
 def test_query_offset_left(self):
     a = AlignedPair(
         ("a", "ABCDEF------"),
         #             |||
         ("b", "--JKLMNOPQRS"))
     r = AlignedRegion(a, 7, 10)
     self.assertEqual(r.in_query(), (6, 6))
     self.assertEqual(r.in_subject(), (5, 8))
     self.assertEqual(r.query_offset(), -1)
     self.assertEqual(r.subject_offset(), 0)
Beispiel #2
0
 def test_query_offset_right(self):
     a = AlignedPair(
         ("a", "------ABCDEF"),
         #       |||
         ("b", "GHIJKLMNOP--"))
     r = AlignedRegion(a, 1, 4)
     self.assertEqual(r.in_query(), (0, 0))
     self.assertEqual(r.in_subject(), (1, 4))
     self.assertEqual(r.query_offset(), 2)
     self.assertEqual(r.subject_offset(), 0)