~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_graph.py

  • Committer: Aaron Bentley
  • Date: 2007-06-21 01:58:29 UTC
  • mto: This revision was merged to the branch mainline in revision 2542.
  • Revision ID: aaron.bentley@utoronto.ca-20070621015829-b62l2d1ehuvgnr3x
Fix iter_topo_order to permit un-included parents

Show diffs side-by-side

added added

removed removed

Lines of Context:
121
121
                    'rev3a': ['rev2a', 'rev2b'], 'rev3b': ['rev2b', 'rev2c']}
122
122
 
123
123
 
124
 
class TestGraphWalker(TestCaseWithMemoryTransport):
 
124
class TestGraph(TestCaseWithMemoryTransport):
125
125
 
126
126
    def make_graph(self, ancestors):
127
127
        tree = self.prepare_memory_tree('.')
281
281
        self.assertEqual([['rev4',], ['rev4']],
282
282
                         stacked.get_parents(['rev1', 'rev1']))
283
283
 
284
 
    def test_iter_topo(self):
 
284
    def test_iter_topo_order(self):
285
285
        graph = self.make_graph(ancestry_1)
286
286
        args = ['rev2a', 'rev3', 'rev1']
287
 
        topo_args = list(graph.iter_topo(args))
 
287
        topo_args = list(graph.iter_topo_order(args))
288
288
        self.assertEqual(set(args), set(topo_args))
289
289
        self.assertTrue(topo_args.index('rev2a') > topo_args.index('rev1'))
290
290
        self.assertTrue(topo_args.index('rev2a') < topo_args.index('rev3'))