Пример #1
0
 def test_completely_different(self):
     self.assertEqual(_expand('abc', 'def', 0), (None, None))
Пример #2
0
 def test_startswith(self):
     self.assertEqual(_expand('abc', 'abcd', 0), (0, 3))
     self.assertEqual(_expand('abc', 'abcd', 1), (0, 3))
     self.assertEqual(_expand('abc', 'abcd', 2), (0, 3))
Пример #3
0
 def test_last_item_missing(self):
     self.assertEqual(_expand('abcd', 'abc', 0), (None, None))
     self.assertEqual(_expand('abcd', 'abc', 1), (1, 3))
     self.assertEqual(_expand('abcd', 'abc', 2), (1, 3))
Пример #4
0
 def test_identical(self):
     self.assertEqual(_expand('abc', 'abc', 0), (0, 3))
     self.assertEqual(_expand('abc', 'abc', 1), (0, 3))
     self.assertEqual(_expand('abc', 'abc', 2), (0, 3))
Пример #5
0
 def test_empty_sequence(self):
     self.assertEqual(_expand('PATTERN', '', 0), (None, None))
Пример #6
0
 def test_empty_subsequence(self):
     self.assertEqual(_expand('', 'TEXT', 0), (0, 0))
Пример #7
0
 def test_both_empty(self):
     self.assertEqual(_expand('', '', 0), (0, 0))