~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__known_graph.py

  • Committer: Martin Pool
  • Date: 2009-07-24 03:15:56 UTC
  • mfrom: (4565 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4566.
  • Revision ID: mbp@sourcefrog.net-20090724031556-5zyef6f1ixtn6r3z
merge news

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""Tests for the python and pyrex extensions of groupcompress"""
 
17
"""Tests for the python and pyrex extensions of KnownGraph"""
18
18
 
19
19
from bzrlib import (
20
20
    errors,
63
63
CompiledKnownGraphFeature = _CompiledKnownGraphFeature()
64
64
 
65
65
 
 
66
#  a
 
67
#  |\
 
68
#  b |
 
69
#  | |
 
70
#  c |
 
71
#   \|
 
72
#    d
 
73
alt_merge = {'a': [], 'b': ['a'], 'c': ['b'], 'd': ['a', 'c']}
 
74
 
 
75
 
66
76
class TestKnownGraph(tests.TestCase):
67
77
 
68
78
    module = None # Set by load_tests
203
213
        self.assertEqual(set(['w', 'q']), graph.heads(['w', 's', 'q']))
204
214
        self.assertEqual(set(['z']), graph.heads(['s', 'z']))
205
215
 
 
216
    def test_heads_alt_merge(self):
 
217
        graph = self.make_known_graph(alt_merge)
 
218
        self.assertEqual(set(['c']), graph.heads(['a', 'c']))
 
219
 
206
220
    def test_heads_with_ghost(self):
207
221
        graph = self.make_known_graph(test_graph.with_ghost)
208
222
        self.assertEqual(set(['e', 'g']), graph.heads(['e', 'g']))