/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/per_transport.py

  • Committer: Jelmer Vernooij
  • Date: 2018-07-07 19:27:38 UTC
  • mto: (7027.4.10 python3-blackbox)
  • mto: This revision was merged to the branch mainline in revision 7038.
  • Revision ID: jelmer@jelmer.uk-20180707192738-cbt5f28lbd3lx4td
Add some more bees; support writing both bytes and unicode strings in build_tree_contents.

Show diffs side-by-side

added added

removed removed

Lines of Context:
183
183
    def test_get_unknown_file(self):
184
184
        t = self.get_transport()
185
185
        files = ['a', 'b']
186
 
        contents = ['contents of a\n',
187
 
                    'contents of b\n',
 
186
        contents = [b'contents of a\n',
 
187
                    b'contents of b\n',
188
188
                    ]
189
189
        self.build_tree(files, transport=t, line_endings='binary')
190
190
        self.assertRaises(NoSuchFile, t.get, 'c')
695
695
 
696
696
        # a file with no parent should fail..
697
697
        self.assertRaises(NoSuchFile,
698
 
                          t.append_bytes, 'missing/path', 'content')
 
698
                          t.append_bytes, 'missing/path', b'content')
699
699
 
700
700
    def test_append_file_mode(self):
701
701
        """Check that append accepts a mode parameter"""
1452
1452
 
1453
1453
        for fname in files:
1454
1454
            fname_utf8 = fname.encode('utf-8')
1455
 
            contents = 'contents of %s\n' % (fname_utf8,)
 
1455
            contents = b'contents of %s\n' % (fname_utf8,)
1456
1456
            self.check_transport_contents(contents, t, urlutils.escape(fname))
1457
1457
 
1458
1458
    def test_connect_twice_is_same_content(self):