/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_graph.py

  • Committer: John Arbash Meinel
  • Date: 2008-03-10 15:10:47 UTC
  • mto: This revision was merged to the branch mainline in revision 3281.
  • Revision ID: john@arbash-meinel.com-20080310151047-4vm0q4357if5q856
Respond to abentley's review comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
250
250
#     a   c
251
251
 
252
252
with_ghost = {'a': ['b'], 'c': ['b', 'd'], 'b':['e'], 'd':['e', 'g'],
253
 
              'e': ['f'], 'f':[NULL_REVISION]}
 
253
              'e': ['f'], 'f':[NULL_REVISION], NULL_REVISION:()}
254
254
 
255
255
 
256
256
 
506
506
        self.assertTrue('null:' not in instrumented_provider.calls)
507
507
 
508
508
    def test_iter_ancestry(self):
509
 
        graph = self.make_graph(boundary)
510
 
        expected = boundary.copy()
 
509
        nodes = boundary.copy()
 
510
        nodes[NULL_REVISION] = ()
 
511
        graph = self.make_graph(nodes)
 
512
        expected = nodes.copy()
511
513
        expected.pop('a') # 'a' is not in the ancestry of 'c', all the
512
514
                          # other nodes are
513
515
        self.assertEqual(expected, dict(graph.iter_ancestry(['c'])))
514
 
        self.assertEqual(boundary, dict(graph.iter_ancestry(['a', 'c'])))
 
516
        self.assertEqual(nodes, dict(graph.iter_ancestry(['a', 'c'])))
515
517
 
516
518
    def test_iter_ancestry_with_ghost(self):
517
519
        graph = self.make_graph(with_ghost)
518
520
        expected = with_ghost.copy()
519
521
        # 'a' is not in the ancestry of 'c', and 'g' is a ghost
520
 
        expected['g'] = ()
 
522
        expected['g'] = None
521
523
        self.assertEqual(expected, dict(graph.iter_ancestry(['a', 'c'])))
522
524
        expected.pop('a') 
523
525
        self.assertEqual(expected, dict(graph.iter_ancestry(['c'])))