~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_win32utils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-07-03 15:41:18 UTC
  • mfrom: (4506.1.1 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090703154118-f5ncmxfk75wgzh6l
(bialix) Setting hidden attribute on win32 should never fail.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
import sys
19
19
 
20
20
from bzrlib import osutils
21
 
from bzrlib.tests import TestCase, TestCaseInTempDir, TestSkipped, Feature
 
21
from bzrlib.tests import (
 
22
    Feature,
 
23
    TestCase,
 
24
    TestCaseInTempDir,
 
25
    TestSkipped,
 
26
    UnicodeFilenameFeature,
 
27
    )
22
28
from bzrlib.win32utils import glob_expand, get_app_path
23
29
from bzrlib import win32utils
24
30
 
238
244
 
239
245
    def restoreCtypes(self):
240
246
        win32utils.has_ctypes = self.old_ctypes
 
247
 
 
248
 
 
249
class TestSetHidden(TestCaseInTempDir):
 
250
 
 
251
    def test_unicode_dir(self):
 
252
        # we should handle unicode paths without errors
 
253
        self.requireFeature(UnicodeFilenameFeature)
 
254
        os.mkdir(u'\u1234')
 
255
        win32utils.set_file_attr_hidden(u'\u1234')
 
256
 
 
257
    def test_dot_bzr_in_unicode_dir(self):
 
258
        # we should not raise traceback if we try to set hidden attribute
 
259
        # on .bzr directory below unicode path
 
260
        self.requireFeature(UnicodeFilenameFeature)
 
261
        os.makedirs(u'\u1234\\.bzr')
 
262
        path = osutils.abspath(u'\u1234\\.bzr')
 
263
        win32utils.set_file_attr_hidden(path)