~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-04-09 20:23:07 UTC
  • mfrom: (4265.1.4 bbc-merge)
  • Revision ID: pqm@pqm.ubuntu.com-20090409202307-n0depb16qepoe21o
(jam) Change _fetch_uses_deltas = False for CHK repos until we can
        write a better fix.

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 (
22
 
    Feature,
23
 
    TestCase,
24
 
    TestCaseInTempDir,
25
 
    TestSkipped,
26
 
    UnicodeFilenameFeature,
27
 
    )
 
21
from bzrlib.tests import TestCase, TestCaseInTempDir, TestSkipped, Feature
28
22
from bzrlib.win32utils import glob_expand, get_app_path
29
23
from bzrlib import win32utils
30
24
 
170
164
            self.assertEquals('iexplore.exe', b.lower())
171
165
            self.assertNotEquals('', d)
172
166
 
173
 
    def test_wordpad(self):
174
 
        # typical windows users should have wordpad in the system
175
 
        # but there is problem: its path has the format REG_EXPAND_SZ
176
 
        # so naive attempt to get the path is not working
177
 
        for a in ('wordpad', 'wordpad.exe'):
178
 
            p = get_app_path(a)
179
 
            d, b = os.path.split(p)
180
 
            self.assertEquals('wordpad.exe', b.lower())
181
 
            self.assertNotEquals('', d)
182
 
 
183
167
    def test_not_existing(self):
184
168
        p = get_app_path('not-existing')
185
169
        self.assertEquals('not-existing', p)
244
228
 
245
229
    def restoreCtypes(self):
246
230
        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)