/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 bzrlib/tests/test_osutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-11-18 22:03:00 UTC
  • mfrom: (4807.2.6 2.1.0b4-win32-accepted)
  • Revision ID: pqm@pqm.ubuntu.com-20091118220300-jh43xy7xqftziwql
(jam) Last few tweaks to get the win32 test suite to pass.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    return s
59
59
 
60
60
 
61
 
def _fs_enc_to_unicode(s):
62
 
    return s.decode(osutils._fs_enc)
63
 
 
64
 
 
65
61
def _utf8_to_unicode(s):
66
62
    return s.decode('UTF-8')
67
63
 
87
83
    if test__walkdirs_win32.Win32ReadDirFeature.available():
88
84
        try:
89
85
            from bzrlib import _walkdirs_win32
90
 
            # TODO: check on windows, it may be that we need to use/add
91
 
            # safe_unicode instead of _fs_enc_to_unicode
92
86
            scenarios.append(
93
87
                ('win32',
94
88
                 dict(_dir_reader_class=_walkdirs_win32.Win32ReadDir,
95
 
                      _native_to_unicode=_fs_enc_to_unicode)))
 
89
                      _native_to_unicode=_already_unicode)))
96
90
        except ImportError:
97
91
            pass
98
92
    return scenarios
1631
1625
        text = 'test\r\nwith\nall\rpossible line endings\r\n'
1632
1626
        self.build_tree_contents([('foo', text)])
1633
1627
        expected_sha = osutils.sha_string(text)
1634
 
        f = open('foo')
 
1628
        f = open('foo', 'rb')
1635
1629
        self.addCleanup(f.close)
1636
1630
        size, sha = osutils.size_sha_file(f)
1637
1631
        self.assertEqual(38, size)