~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_reference.py

  • Committer: Vincent Ladeuil
  • Date: 2016-01-21 17:48:07 UTC
  • mto: This revision was merged to the branch mainline in revision 6613.
  • Revision ID: v.ladeuil+lp@free.fr-20160121174807-g4ybpaij9ln5wj6a
Make all transport put_bytes() raises TypeError when given unicode strings rather than bytes.

There was a mix of AssertionError or UnicodeEncodeError.

Also deleted test_put_file_unicode() which was bogus, files contain bytes not unicode strings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
from bzrlib import (
19
19
    branch as _mod_branch,
20
 
    bzrdir,
 
20
    controldir,
21
21
    )
22
22
from bzrlib.tests import TestCaseWithTransport
23
23
 
24
24
 
25
25
class TestReference(TestCaseWithTransport):
26
26
 
27
 
    def make_branch(self, location, format=None):
28
 
        if format is None:
29
 
            format = bzrdir.format_registry.make_bzrdir('1.9')
30
 
            format.set_branch_format(_mod_branch.BzrBranchFormat8())
31
 
        return TestCaseWithTransport.make_branch(self, location, format=format)
 
27
    def get_default_format(self):
 
28
        format = controldir.format_registry.make_bzrdir('1.9')
 
29
        format.set_branch_format(_mod_branch.BzrBranchFormat8())
 
30
        return format
32
31
 
33
32
    def test_no_args_lists(self):
34
33
        branch = self.make_branch('branch')