Exemple #1
0
 def test_append_added_line(self):
     hunk = Hunk(src_len=0, tgt_len=1)
     hunk.append_added_line(self.sample_line)
     self.assertTrue(hunk.is_valid())
     self.assertEqual(len(hunk.target_lines), 1)
     self.assertEqual(hunk.source_lines, [])
     self.assertIn(self.sample_line, hunk.target_lines)
Exemple #2
0
 def test_append_added_line(self):
     hunk = Hunk(src_len=0, tgt_len=1)
     hunk.append_added_line(self.sample_line)
     self.assertTrue(hunk.is_valid())
     self.assertEqual(len(hunk.target_lines), 1)
     self.assertEqual(hunk.source_lines, [])
     self.assertIn(self.sample_line, hunk.target_lines)
Exemple #3
0
 def test_modified_counter(self):
     hunk = Hunk(src_len=1, tgt_len=1)
     hunk.append_deleted_line(self.sample_line)
     hunk.append_added_line(self.sample_line)
     hunk.add_to_modified_counter(1)
     self.assertTrue(hunk.is_valid())
     self.assertEqual(hunk.modified, 1)
     self.assertEqual(hunk.added, 0)
     self.assertEqual(hunk.deleted, 0)
Exemple #4
0
 def test_modified_counter(self):
     hunk = Hunk(src_len=1, tgt_len=1)
     hunk.append_deleted_line(self.sample_line)
     hunk.append_added_line(self.sample_line)
     hunk.add_to_modified_counter(1)
     self.assertTrue(hunk.is_valid())
     self.assertEqual(hunk.modified, 1)
     self.assertEqual(hunk.added, 0)
     self.assertEqual(hunk.deleted, 0)