/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_branch.py

  • Committer: Jelmer Vernooij
  • Date: 2018-06-18 20:53:01 UTC
  • mto: (6973.12.2 python3-k)
  • mto: This revision was merged to the branch mainline in revision 7005.
  • Revision ID: jelmer@jelmer.uk-20180618205301-th8s5bphhn2m2su6
Fix some tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
112
112
        branch = self.make_branch('.', format='knit')
113
113
        branch.set_push_location('foo')
114
114
        local_path = urlutils.local_path_from_url(branch.base[:-1])
115
 
        self.assertFileEqual("# comment\n"
116
 
                             "[%s]\n"
117
 
                             "push_location = foo\n"
118
 
                             "push_location:policy = norecurse\n" % local_path,
 
115
        self.assertFileEqual(b"# comment\n"
 
116
                             b"[%s]\n"
 
117
                             b"push_location = foo\n"
 
118
                             b"push_location:policy = norecurse\n" % local_path,
119
119
                             config.locations_config_filename())
120
120
 
121
121
    # TODO RBC 20051029 test getting a push location from a branch in a
522
522
        reference_url = branch.controldir.root_transport.abspath('') + '/'
523
523
        # if the api for create_checkout changes to return different checkout types
524
524
        # then this file read will fail.
525
 
        self.assertFileEqual(reference_url, 'checkout/.bzr/branch/location')
 
525
        self.assertFileEqual(reference_url.encode('utf-8'),
 
526
                             'checkout/.bzr/branch/location')
526
527
        self.assertEqual(reference_url,
527
528
            _mod_bzrbranch.BranchReferenceFormat().get_reference(checkout.controldir))
528
529
 
683
684
 
684
685
    def test_report_changed(self):
685
686
        r = _mod_branch.PullResult()
686
 
        r.old_revid = "old-revid"
 
687
        r.old_revid = b"old-revid"
687
688
        r.old_revno = 10
688
 
        r.new_revid = "new-revid"
 
689
        r.new_revid = b"new-revid"
689
690
        r.new_revno = 20
690
691
        f = BytesIO()
691
692
        r.report(f)
692
 
        self.assertEqual("Now on revision 20.\n", f.getvalue())
693
 
        self.assertEqual("Now on revision 20.\n", f.getvalue())
 
693
        self.assertEqual(b"Now on revision 20.\n", f.getvalue())
 
694
        self.assertEqual(b"Now on revision 20.\n", f.getvalue())
694
695
 
695
696
    def test_report_unchanged(self):
696
697
        r = _mod_branch.PullResult()
697
 
        r.old_revid = "same-revid"
698
 
        r.new_revid = "same-revid"
 
698
        r.old_revid = b"same-revid"
 
699
        r.new_revid = b"same-revid"
699
700
        f = BytesIO()
700
701
        r.report(f)
701
 
        self.assertEqual("No revisions or tags to pull.\n", f.getvalue())
 
702
        self.assertEqual(b"No revisions or tags to pull.\n", f.getvalue())