~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testrevision.py

  • Committer: aaron.bentley at utoronto
  • Date: 2005-08-27 04:42:41 UTC
  • mfrom: (1092.1.43)
  • mto: (1185.3.4)
  • mto: This revision was merged to the branch mainline in revision 1178.
  • Revision ID: aaron.bentley@utoronto.ca-20050827044241-23d676133b9fc981
Merge of robertc@robertcollins.net-20050826013321-52eee1f1da679ee9

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
 
48
48
 
49
49
class TestIsAncestor(InTempDir):
50
 
    """Test checking whether a revision is an ancestor of another revision"""
51
 
    def runTest(self):
 
50
 
 
51
    def test_is_ancestor(self):
 
52
        """Test checking whether a revision is an ancestor of another revision"""
52
53
        from bzrlib.revision import is_ancestor, MultipleRevisionSources
53
54
        from bzrlib.errors import NoSuchRevision
54
55
        br1, br2 = make_branches()
68
69
        assert not is_ancestor(revisions[3], revisions_2[3], br1)
69
70
 
70
71
class TestIntermediateRevisions(InTempDir):
 
72
 
71
73
    def setUp(self):
72
74
        from bzrlib.commit import commit
 
75
        InTempDir.setUp(self)
73
76
        self.br1, self.br2 = make_branches()
74
77
        commit(self.br2, "Commit eleven", rev_id="b@u-0-7")
75
78
        commit(self.br2, "Commit twelve", rev_id="b@u-0-8")
87
90
        return get_intervening_revisions(ancestor,revision, self.sources, 
88
91
                                         revision_history)
89
92
 
90
 
    def runTest(self):
 
93
    def test_intervene(self):
91
94
        """Find intermediate revisions, without requiring history"""
92
95
        from bzrlib.errors import NotAncestor, NoSuchRevision
93
96
        assert len(self.intervene('a@u-0-0', 'a@u-0-0')) == 0
130
133
 
131
134
class TestCommonAncestor(InTempDir):
132
135
    """Test checking whether a revision is an ancestor of another revision"""
133
 
    def runTest(self):
 
136
 
 
137
    def test_common_ancestor(self):
134
138
        from bzrlib.revision import find_present_ancestors, common_ancestor
135
139
        from bzrlib.revision import MultipleRevisionSources
136
140
        br1, br2 = make_branches()
167
171
                          revisions[4])
168
172
        self.assertEqual(common_ancestor(revisions_2[6], revisions[5], sources),
169
173
                          revisions_2[5])
170
 
 
171
 
TEST_CLASSES = [
172
 
    TestIsAncestor,
173
 
    TestCommonAncestor,
174
 
    TestIntermediateRevisions,
175
 
    ]