~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_win32utils.py

  • Committer: Vincent Ladeuil
  • Date: 2009-07-03 14:41:31 UTC
  • mfrom: (4505.2.4 hidden_dot_bzr_unicode)
  • mto: This revision was merged to the branch mainline in revision 4507.
  • Revision ID: v.ladeuil+lp@free.fr-20090703144131-gtrc803t0qs6olv0
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)