~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test__walkdirs_win32.py

  • Committer: John Arbash Meinel
  • Date: 2008-07-17 03:46:13 UTC
  • mto: This revision was merged to the branch mainline in revision 3557.
  • Revision ID: john@arbash-meinel.com-20080717034613-3cqwmu9mfshqwyet
Some code cleanups.

Remove extra comments.
Use 64 bit integer math when possible.
Use PyList_Append rather than foo.append()
Use PyUnicode_AsUTF8String rather than codecs.encode()
Make sure to raise an exception if the target directory doesn't exist.
Seems to have made a significant performance impact.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""Tests for the win32 walkdir extension."""
18
18
 
 
19
import errno
 
20
 
19
21
from bzrlib import tests
20
22
 
21
23
 
111
113
        third_dirblock = self._remove_stat_from_dirblock(third_dirblock)
112
114
        self.assertEqual(('c', u'./c'), dir_info)
113
115
        self.assertEqual([('c/cc', 'cc', 'file', u'./c/cc')], third_dirblock)
 
116
 
 
117
    def test_missing_dir(self):
 
118
        e = self.assertRaises(WindowsError, list,
 
119
                                self.walkdirs_utf8(u'no_such_dir'))
 
120
        self.assertEqual(errno.ENOENT, e.errno)
 
121
        self.assertEqual(3, e.winerror)
 
122
        self.assertEqual((3, u'no_such_dir/*'), e.args)