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

  • Committer: Jelmer Vernooij
  • Date: 2018-05-06 11:48:54 UTC
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180506114854-h4qd9ojaqy8wxjsd
Move .mailmap to root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
        self.assertEqual(text_file(s).read(), s.getvalue())
35
35
 
36
36
    def test_check_text_lines(self):
37
 
        lines = [b'ab' * 2048]
 
37
        lines = ['ab' * 2048]
38
38
        check_text_lines(lines)
39
 
        lines = [b'a' * 1023 + b'\x00']
 
39
        lines = ['a' * 1023 + '\x00']
40
40
        self.assertRaises(BinaryFile, check_text_lines, lines)
41
41
 
42
42
 
43
43
class TextPath(TestCaseInTempDir):
44
44
 
45
45
    def test_text_file(self):
46
 
        with open('boo', 'wb') as f:
47
 
            f.write(b'ab' * 2048)
 
46
        with file('boo', 'wb') as f: f.write('ab' * 2048)
48
47
        check_text_path('boo')
49
 
        with open('boo', 'wb') as f:
50
 
            f.write(b'a' * 1023 + b'\x00')
 
48
        with file('boo', 'wb') as f: f.write('a' * 1023 + '\x00')
51
49
        self.assertRaises(BinaryFile, check_text_path, 'boo')