/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 breezy/tests/test_win32utils.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-03 23:48:08 UTC
  • mfrom: (7316 work)
  • mto: This revision was merged to the branch mainline in revision 7328.
  • Revision ID: jelmer@jelmer.uk-20190603234808-15yk5c7054tj8e2b
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
 
38
38
Win32RegistryFeature = features.ModuleAvailableFeature('_winreg')
39
 
 
 
39
CtypesFeature = features.ModuleAvailableFeature('ctypes')
 
40
Win32comShellFeature = features.ModuleAvailableFeature('win32com.shell')
 
41
Win32ApiFeature = features.ModuleAvailableFeature('win32api')
 
42
 
 
43
 
 
44
# Tests
 
45
# -----
40
46
 
41
47
class TestWin32UtilsGlobExpand(TestCaseInTempDir):
42
48
 
181
187
        self.assertEqual('not-existing', p)
182
188
 
183
189
 
184
 
class TestLocations(TestCase):
 
190
class TestLocationsCtypes(TestCase):
185
191
 
186
 
    _test_needs_features = [features.win32_feature]
 
192
    _test_needs_features = [CtypesFeature, features.win32_feature]
187
193
 
188
194
    def assertPathsEqual(self, p1, p2):
189
195
        # TODO: The env var values in particular might return the "short"
227
233
            self.assertPathsEqual(lad, env.decode(encoding))
228
234
 
229
235
 
 
236
class TestLocationsPywin32(TestLocationsCtypes):
 
237
 
 
238
    _test_needs_features = [Win32comShellFeature]
 
239
 
 
240
    def setUp(self):
 
241
        super(TestLocationsPywin32, self).setUp()
 
242
        # We perform the exact same tests after disabling the use of ctypes.
 
243
        # This causes the implementation to fall back to pywin32.
 
244
        self.overrideAttr(win32utils, 'has_ctypes', False)
 
245
        # FIXME: this should be done by parametrization -- vila 100123
 
246
 
 
247
 
230
248
class TestSetHidden(TestCaseInTempDir):
231
249
 
232
 
    _test_needs_features = [features.win32_feature]
233
 
 
234
250
    def test_unicode_dir(self):
235
251
        # we should handle unicode paths without errors
236
252
        self.requireFeature(features.UnicodeFilenameFeature)
319
335
class TestGetEnvironUnicode(tests.TestCase):
320
336
    """Tests for accessing the environment via the windows wide api"""
321
337
 
322
 
    _test_needs_features = [features.win32_feature]
 
338
    _test_needs_features = [CtypesFeature, features.win32_feature]
323
339
 
324
340
    def setUp(self):
325
341
        super(TestGetEnvironUnicode, self).setUp()