~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:12:19 UTC
  • mto: This revision was merged to the branch mainline in revision 2542.
  • Revision ID: aaron.bentley@utoronto.ca-20070621011219-a967wm19vxxc8dx5
Add functionality for tsorting graphs

Show diffs side-by-side

added added

removed removed

Lines of Context:
280
280
                         stacked.get_parents(['rev2', 'rev2']))
281
281
        self.assertEqual([['rev4',], ['rev4']],
282
282
                         stacked.get_parents(['rev1', 'rev1']))
 
283
 
 
284
    def test_iter_topo(self):
 
285
        graph = self.make_graph(ancestry_1)
 
286
        args = ['rev2a', 'rev3', 'rev1']
 
287
        topo_args = list(graph.iter_topo(args))
 
288
        self.assertEqual(set(args), set(topo_args))
 
289
        self.assertTrue(topo_args.index('rev2a') > topo_args.index('rev1'))
 
290
        self.assertTrue(topo_args.index('rev2a') < topo_args.index('rev3'))