~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_revision.py

  • Committer: Andrew Bennetts
  • Date: 2007-08-30 08:11:54 UTC
  • mfrom: (2766 +trunk)
  • mto: (2535.3.55 repo-refactor)
  • mto: This revision was merged to the branch mainline in revision 2772.
  • Revision ID: andrew.bennetts@canonical.com-20070830081154-16hebp2xwr15x2hc
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        r'bzrlib\.tests\.test_revision')
40
40
 
41
41
# XXX: Make this a method of a merge base case
42
 
def make_branches(self):
 
42
def make_branches(self, format=None):
43
43
    """Create two branches
44
44
 
45
45
    branch 1 has 6 commits, branch 2 has 3 commits
58
58
    so A is missing b6 at the start
59
59
    and B is missing a3, a4, a5
60
60
    """
61
 
    tree1 = self.make_branch_and_tree("branch1")
 
61
    tree1 = self.make_branch_and_tree("branch1", format=format)
62
62
    br1 = tree1.branch
63
63
    
64
64
    tree1.commit("Commit one", rev_id="a@u-0-0")
309
309
        self.assertEqual(False, revision.is_reserved_id(
310
310
            'arch:a@example.com/c--b--v--r'))
311
311
        self.assertEqual(False, revision.is_reserved_id(None))
 
312
 
 
313
 
 
314
class TestRevisionMethods(TestCase):
 
315
 
 
316
    def test_get_summary(self):
 
317
        r = revision.Revision('1')
 
318
        r.message = 'a'
 
319
        self.assertEqual('a', r.get_summary())
 
320
        r.message = 'a\nb'
 
321
        self.assertEqual('a', r.get_summary())
 
322
        r.message = '\na\nb'
 
323
        self.assertEqual('a', r.get_summary())
 
324
 
 
325
    def test_get_apparent_author(self):
 
326
        r = revision.Revision('1')
 
327
        r.committer = 'A'
 
328
        self.assertEqual('A', r.get_apparent_author())
 
329
        r.properties['author'] = 'B'
 
330
        self.assertEqual('B', r.get_apparent_author())