~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_graph.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-08-06 02:23:37 UTC
  • mfrom: (4332.3.36 check)
  • Revision ID: pqm@pqm.ubuntu.com-20090806022337-7c2oni07fsjq6gun
(robertc) Partial overhaul of check to do less duplicate work.
        (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
526
526
        graph = self.make_graph(history_shortcut)
527
527
        self.assertEqual(set(['rev2b']), graph.find_lca('rev3a', 'rev3b'))
528
528
 
 
529
    def test_lefthand_distance_smoke(self):
 
530
        """A simple does it work test for graph.lefthand_distance(keys)."""
 
531
        graph = self.make_graph(history_shortcut)
 
532
        distance_graph = graph.find_lefthand_distances(['rev3b', 'rev2a'])
 
533
        self.assertEqual({'rev2a': 2, 'rev3b': 3}, distance_graph)
 
534
 
 
535
    def test_lefthand_distance_ghosts(self):
 
536
        """A simple does it work test for graph.lefthand_distance(keys)."""
 
537
        nodes = {'nonghost':[NULL_REVISION], 'toghost':['ghost']}
 
538
        graph = self.make_graph(nodes)
 
539
        distance_graph = graph.find_lefthand_distances(['nonghost', 'toghost'])
 
540
        self.assertEqual({'nonghost': 1, 'toghost': -1}, distance_graph)
 
541
 
529
542
    def test_recursive_unique_lca(self):
530
543
        """Test finding a unique least common ancestor.
531
544