~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: 2007-08-21 02:46:21 UTC
  • mfrom: (2681.1.40 send-bundle)
  • Revision ID: pqm@pqm.ubuntu.com-20070821024621-czmqk59igiyvsgk8
"send" now sends the message as an attachment

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
import os
17
18
import sys
18
19
 
19
20
from bzrlib import osutils
20
21
from bzrlib.tests import TestCase, TestCaseInTempDir, Feature
21
 
from bzrlib.win32utils import glob_expand
 
22
from bzrlib.win32utils import glob_expand, get_app_path
22
23
 
23
24
 
24
25
# Features
35
36
NeedsGlobExpansionFeature = _NeedsGlobExpansionFeature()
36
37
 
37
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
 
38
54
# Tests
39
55
# -----
40
56
 
128
144
            result.sort()
129
145
            self.assertEqual(expected, result, 'pattern %s' % pattern)
130
146
 
 
147
 
 
148
class TestAppPaths(TestCase):
 
149
 
 
150
    _test_needs_features = [Win32RegistryFeature]
 
151
 
 
152
    def test_iexplore(self):
 
153
        # typical windows users should have IE installed
 
154
        for a in ('iexplore', 'iexplore.exe'):
 
155
            p = get_app_path(a)
 
156
            d, b = os.path.split(p)
 
157
            self.assertEquals('iexplore.exe', b)
 
158
            self.assertNotEquals('', d)
 
159
 
 
160
    def test_not_existing(self):
 
161
        p = get_app_path('not-existing')
 
162
        self.assertEquals('not-existing', p)