~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/selftest/testrevision.py

  • Committer: Martin Pool
  • Date: 2005-08-25 09:17:19 UTC
  • Revision ID: mbp@sourcefrog.net-20050825091719-b2d7be7bf56bb35a
- fix a few errors in new merge code

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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
 
from bzrlib.selftest import FunctionalTestCase
 
17
from bzrlib.selftest import InTempDir
18
18
 
19
19
 
20
20
def make_branches():
46
46
    return br1, br2
47
47
 
48
48
 
49
 
class TestIsAncestor(FunctionalTestCase):
 
49
class TestIsAncestor(InTempDir):
 
50
 
50
51
    def test_is_ancestor(self):
51
52
        """Test checking whether a revision is an ancestor of another revision"""
52
53
        from bzrlib.revision import is_ancestor, MultipleRevisionSources
68
69
        assert not is_ancestor(revisions[3], revisions_2[3], br1)
69
70
 
70
71
 
71
 
class TestCommonAncestor(FunctionalTestCase):
 
72
class TestCommonAncestor(InTempDir):
72
73
    """Test checking whether a revision is an ancestor of another revision"""
73
 
 
74
 
    def test_common_ancestor(self):
 
74
    def runTest(self):
75
75
        from bzrlib.revision import find_present_ancestors, common_ancestor
76
76
        from bzrlib.revision import MultipleRevisionSources
77
77
        br1, br2 = make_branches()
108
108
                          revisions[4])
109
109
        self.assertEqual(common_ancestor(revisions_2[6], revisions[5], sources),
110
110
                          revisions_2[5])
 
111
 
 
112
TEST_CLASSES = [
 
113
    TestIsAncestor,
 
114
    TestCommonAncestor,
 
115
    ]