~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-29 10:57:01 UTC
  • mfrom: (1092.1.41)
  • Revision ID: mbp@sourcefrog.net-20050829105701-7aaa81ecf1bfee05
- merge in merge improvements and additional tests 
  from aaron and lifeless

robertc@robertcollins.net-20050825131100-85772edabc817481

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 InTempDir
 
17
from bzrlib.selftest import FunctionalTestCase
18
18
 
19
19
 
20
20
def make_branches():
46
46
    return br1, br2
47
47
 
48
48
 
49
 
class TestIsAncestor(InTempDir):
50
 
 
 
49
class TestIsAncestor(FunctionalTestCase):
51
50
    def test_is_ancestor(self):
52
51
        """Test checking whether a revision is an ancestor of another revision"""
53
52
        from bzrlib.revision import is_ancestor, MultipleRevisionSources
69
68
        assert not is_ancestor(revisions[3], revisions_2[3], br1)
70
69
 
71
70
 
72
 
class TestCommonAncestor(InTempDir):
 
71
class TestCommonAncestor(FunctionalTestCase):
73
72
    """Test checking whether a revision is an ancestor of another revision"""
74
 
    def runTest(self):
 
73
 
 
74
    def test_common_ancestor(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
 
    ]