~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_graph.py

  • Committer: John Arbash Meinel
  • Date: 2008-02-25 22:41:36 UTC
  • mto: This revision was merged to the branch mainline in revision 3281.
  • Revision ID: john@arbash-meinel.com-20080225224136-g5dpjx3nzxcwbvvm
Change iter_ancestry to take a group instead of a single node,

Show diffs side-by-side

added added

removed removed

Lines of Context:
510
510
        expected = boundary.copy()
511
511
        expected.pop('a') # 'a' is not in the ancestry of 'c', all the
512
512
                          # other nodes are
513
 
        self.assertEqual(expected, dict(graph.iter_ancestry('c')))
 
513
        self.assertEqual(expected, dict(graph.iter_ancestry(['c'])))
 
514
        self.assertEqual(boundary, dict(graph.iter_ancestry(['a', 'c'])))
514
515
 
515
516
    def test_iter_ancestry_with_ghost(self):
516
517
        graph = self.make_graph(with_ghost)
517
518
        expected = with_ghost.copy()
518
519
        # 'a' is not in the ancestry of 'c', and 'g' is a ghost
 
520
        expected['g'] = ()
 
521
        self.assertEqual(expected, dict(graph.iter_ancestry(['a', 'c'])))
519
522
        expected.pop('a') 
520
 
        expected['g'] = ()
521
 
        self.assertEqual(expected, dict(graph.iter_ancestry('c')))
 
523
        self.assertEqual(expected, dict(graph.iter_ancestry(['c'])))
522
524
 
523
525
    def test_filter_candidate_lca(self):
524
526
        """Test filter_candidate_lca for a corner case