~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__known_graph.py

  • Committer: Vincent Ladeuil
  • Date: 2009-06-18 19:45:24 UTC
  • mto: This revision was merged to the branch mainline in revision 4466.
  • Revision ID: v.ladeuil+lp@free.fr-20090618194524-poedor61th3op5dm
Cleanup.

* bzrlib/tests/test__known_graph.py:
(TestKnownGraph): Delete dominator tests.

* bzrlib/_known_graph_pyx.pyx: 
Cleanup all references to old version and linear dominators :-/

* bzrlib/_known_graph_py.py: 
Cleanup all references to old version and linear dominators :-/

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
    def make_known_graph(self, ancestry):
72
72
        return self.module.KnownGraph(ancestry, do_cache=self.do_cache)
73
73
 
74
 
    def assertDominator(self, graph, rev, dominator):
75
 
        node = graph._nodes[rev]
76
 
        self.assertEqual(dominator, node.linear_dominator)
77
 
 
78
74
    def assertGDFO(self, graph, rev, gdfo):
79
75
        node = graph._nodes[rev]
80
76
        self.assertEqual(gdfo, node.gdfo)
88
84
        self.assertEqual(['rev4'], sorted(graph._nodes['rev3'].child_keys))
89
85
        self.assertEqual(['rev4'], sorted(graph._nodes['rev2b'].child_keys))
90
86
 
91
 
    def test_dominators_ancestry_1(self):
92
 
        graph = self.make_known_graph(test_graph.ancestry_1)
93
 
        self.assertDominator(graph, 'rev1', NULL_REVISION)
94
 
        self.assertDominator(graph, 'rev2b', 'rev2b')
95
 
        self.assertDominator(graph, 'rev2a', 'rev2a')
96
 
        self.assertDominator(graph, 'rev3', 'rev2a')
97
 
        self.assertDominator(graph, 'rev4', 'rev4')
98
 
 
99
 
    def test_dominators_feature_branch(self):
100
 
        graph = self.make_known_graph(test_graph.feature_branch)
101
 
        self.assertDominator(graph, 'rev1', NULL_REVISION)
102
 
        self.assertDominator(graph, 'rev2b', NULL_REVISION)
103
 
        self.assertDominator(graph, 'rev3b', NULL_REVISION)
104
 
 
105
 
    def test_dominators_extended_history_shortcut(self):
106
 
        graph = self.make_known_graph(test_graph.extended_history_shortcut)
107
 
        self.assertDominator(graph, 'a', NULL_REVISION)
108
 
        self.assertDominator(graph, 'b', 'b')
109
 
        self.assertDominator(graph, 'c', 'b')
110
 
        self.assertDominator(graph, 'd', 'b')
111
 
        self.assertDominator(graph, 'e', 'e')
112
 
        self.assertDominator(graph, 'f', 'f')
113
 
 
114
87
    def test_gdfo_ancestry_1(self):
115
88
        graph = self.make_known_graph(test_graph.ancestry_1)
116
89
        self.assertGDFO(graph, 'rev1', 2)