~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_graph.py

  • Committer: Andrew Bennetts
  • Date: 2009-03-06 08:13:23 UTC
  • mto: (4086.1.2 hpss-integration)
  • mto: This revision was merged to the branch mainline in revision 4087.
  • Revision ID: andrew.bennetts@canonical.com-20090306081323-dunguef2eok4wyti
Tweaks requested by Robert's review.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1525
1525
        # 2 and 3 cannot be removed because 1 has 2 parents
1526
1526
        d = {1:[2, 3], 2:[4], 4:[6], 3:[5], 5:[6], 6:[7], 7:[]}
1527
1527
        self.assertCollapsed(d, d)
 
1528
 
 
1529
 
 
1530
class TestPendingAncestryResult(TestCaseWithMemoryTransport):
 
1531
    """Tests for bzrlib.graph.PendingAncestryResult."""
 
1532
 
 
1533
    def test_get_keys(self):
 
1534
        builder = self.make_branch_builder('b')
 
1535
        builder.start_series()
 
1536
        builder.build_snapshot('rev-1', None, [
 
1537
            ('add', ('', 'root-id', 'directory', ''))])
 
1538
        builder.build_snapshot('rev-2', ['rev-1'], [])
 
1539
        builder.finish_series()
 
1540
        repo = builder.get_branch().repository
 
1541
        repo.lock_read()
 
1542
        self.addCleanup(repo.unlock)
 
1543
        par = _mod_graph.PendingAncestryResult(['rev-2'], repo)
 
1544
        self.assertEqual(set(['rev-1', 'rev-2']), set(par.get_keys()))
 
1545