~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_branch.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-01-14 00:01:32 UTC
  • mfrom: (4957.1.1 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100114000132-3p3rabnonjw3gzqb
(jam) Merge bzr.stable, bringing in bug fixes #175839, #504390

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for the Branch facility that are not interface  tests.
18
18
 
19
 
For interface tests see tests/branch_implementations/*.py.
 
19
For interface tests see tests/per_branch/*.py.
20
20
 
21
21
For concrete class tests see this file, and for meta-branch tests
22
22
also see this file.
40
40
    BzrBranch5,
41
41
    BzrBranchFormat5,
42
42
    BzrBranchFormat6,
 
43
    BzrBranchFormat7,
43
44
    PullResult,
44
45
    _run_with_write_locked_target,
45
46
    )
60
61
    def test_default_format(self):
61
62
        # update this if you change the default branch format
62
63
        self.assertIsInstance(BranchFormat.get_default_format(),
63
 
                BzrBranchFormat6)
 
64
                BzrBranchFormat7)
64
65
 
65
66
    def test_default_format_is_same_as_bzrdir_default(self):
66
67
        # XXX: it might be nice if there was only one place the default was
503
504
        a = "%d revisions pulled" % r
504
505
        self.assertEqual(a, "10 revisions pulled")
505
506
 
 
507
    def test_report_changed(self):
 
508
        r = PullResult()
 
509
        r.old_revid = "old-revid"
 
510
        r.old_revno = 10
 
511
        r.new_revid = "new-revid"
 
512
        r.new_revno = 20
 
513
        f = StringIO()
 
514
        r.report(f)
 
515
        self.assertEqual("Now on revision 20.\n", f.getvalue())
 
516
 
 
517
    def test_report_unchanged(self):
 
518
        r = PullResult()
 
519
        r.old_revid = "same-revid"
 
520
        r.new_revid = "same-revid"
 
521
        f = StringIO()
 
522
        r.report(f)
 
523
        self.assertEqual("No revisions to pull.\n", f.getvalue())
506
524
 
507
525
 
508
526
class _StubLockable(object):