~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_knit.py

  • Committer: Andrew Bennetts
  • Date: 2009-04-22 07:00:51 UTC
  • mto: This revision was merged to the branch mainline in revision 4307.
  • Revision ID: andrew.bennetts@canonical.com-20090422070051-u1v1th1yqv1ui7ps
Add another test for _KnitGraphIndex.get_missing_parents().

Show diffs side-by-side

added added

removed removed

Lines of Context:
1679
1679
        self.assertEqual(
1680
1680
            frozenset([('missing-parent',)]), index.get_missing_parents())
1681
1681
 
 
1682
    def test_track_external_parent_refs(self):
 
1683
        g_index = self.make_g_index('empty', 2, [])
 
1684
        combined = CombinedGraphIndex([g_index])
 
1685
        index = _KnitGraphIndex(combined, lambda: True, deltas=True,
 
1686
            add_callback=self.catch_add, track_external_parent_refs=True)
 
1687
        self.caught_entries = []
 
1688
        index.add_records([
 
1689
            (('new-key',), 'fulltext,no-eol', (None, 50, 60),
 
1690
             [('parent-1',), ('parent-2',)])])
 
1691
        self.assertEqual(
 
1692
            frozenset([('parent-1',), ('parent-2',)]),
 
1693
            index.get_missing_parents())
 
1694
 
1682
1695
    def test_add_unvalidated_index_with_present_external_references(self):
1683
1696
        index = self.two_graph_index(deltas=True)
1684
1697
        # Ugly hack to get at one of the underlying GraphIndex objects that