140
140
except NotImplementedError:
143
def test_add_reserved(self):
145
self.assertRaises(errors.ReservedId,
146
vf.add_lines, 'a:', [], ['a\n', 'b\n', 'c\n'])
148
self.assertRaises(errors.ReservedId,
149
vf.add_delta, 'a:', [], None, 'sha1', False, ((0, 0, 0, []),))
151
def test_get_reserved(self):
153
self.assertRaises(errors.ReservedId, vf.get_delta, 'b:')
154
self.assertRaises(errors.ReservedId, vf.get_texts, ['b:'])
155
self.assertRaises(errors.ReservedId, vf.get_lines, 'b:')
156
self.assertRaises(errors.ReservedId, vf.get_text, 'b:')
143
158
def test_get_delta(self):
144
159
f = self.get_file()
145
160
sha1s = self._setup_for_deltas(f)
586
601
if []!= progress.updates:
587
602
self.assertEqual(expected, progress.updates)
589
lines = iter_with_versions(['child', 'otherchild'],
590
[('Walking content.', 0, 2),
591
('Walking content.', 0, 2),
592
('Walking content.', 3, 2),
604
lines = iter_with_versions(['child', 'otherchild'],
605
[('Walking content.', 0, 2),
606
('Walking content.', 1, 2),
593
607
('Walking content.', 2, 2)])
594
608
# we must see child and otherchild
595
609
self.assertTrue(lines['child\n'] > 0)
597
611
# we dont care if we got more than that.
600
lines = iter_with_versions(None, [('Walking content.', 0, 5),
601
('Walking content.', 0, 5),
602
('Walking content.', 1, 5),
603
('Walking content.', 2, 5),
604
('Walking content.', 2, 5),
605
('Walking content.', 3, 5),
614
lines = iter_with_versions(None, [('Walking content.', 0, 5),
615
('Walking content.', 1, 5),
616
('Walking content.', 2, 5),
617
('Walking content.', 3, 5),
618
('Walking content.', 4, 5),
606
619
('Walking content.', 5, 5)])
607
620
# all lines must be seen at least once
608
621
self.assertTrue(lines['base\n'] > 0)
664
677
self.assertRaises(NotImplementedError, vf.get_parents_with_ghosts, 'foo')
665
678
self.assertRaises(NotImplementedError, vf.get_graph_with_ghosts)
680
vf = self.reopen_file()
667
681
# test key graph related apis: getncestry, _graph, get_parents
669
683
# - these are ghost unaware and must not be reflect ghosts