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

  • Committer: Alexander Belchenko
  • Date: 2007-08-11 05:59:59 UTC
  • mto: (2681.1.33 send-bundle)
  • mto: This revision was merged to the branch mainline in revision 2736.
  • Revision ID: bialix@ukr.net-20070811055959-frzthpfkjipgf3o3
test use Feature instead of TestSkipped

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, Feature, TestSkipped
 
21
from bzrlib.tests import TestCase, TestCaseInTempDir, Feature
22
22
from bzrlib.win32utils import glob_expand, get_app_path
23
23
 
24
24
 
36
36
NeedsGlobExpansionFeature = _NeedsGlobExpansionFeature()
37
37
 
38
38
 
 
39
class _Win32RegistryFeature(Feature):
 
40
 
 
41
    def _probe(self):
 
42
        try:
 
43
            import _winreg
 
44
            return True
 
45
        except ImportError:
 
46
            return False
 
47
 
 
48
    def feature_name(self):
 
49
        return '_winreg'
 
50
 
 
51
Win32RegistryFeature = _Win32RegistryFeature()
 
52
 
 
53
 
39
54
# Tests
40
55
# -----
41
56
 
132
147
 
133
148
class TestAppPaths(TestCase):
134
149
 
 
150
    _test_needs_features = [Win32RegistryFeature]
 
151
 
135
152
    def test_iexplore(self):
136
 
        if sys.platform != 'win32':
137
 
            raise TestSkipped('win32-specific')
138
153
        # typical windows users should have IE installed
139
154
        for a in ('iexplore', 'iexplore.exe'):
140
155
            p = get_app_path(a)
143
158
            self.assertNotEquals('', d)
144
159
 
145
160
    def test_not_existing(self):
146
 
        if sys.platform != 'win32':
147
 
            raise TestSkipped('win32-specific')
148
161
        p = get_app_path('not-existing')
149
162
        self.assertEquals('not-existing', p)