~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/features.py

  • Committer: Andrew Bennetts
  • Date: 2010-10-08 04:25:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5472.
  • Revision ID: andrew.bennetts@canonical.com-20101008042510-sg9vdhmnggilzxsk
Fix stray TAB in source.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009, 2010, 2011 Canonical Ltd
 
1
# Copyright (C) 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
19
19
import os
20
20
import stat
21
21
 
22
 
from bzrlib import (
23
 
    osutils,
24
 
    tests,
25
 
    )
 
22
from bzrlib import tests
 
23
from bzrlib.symbol_versioning import deprecated_in
26
24
 
27
25
 
28
26
class _NotRunningAsRoot(tests.Feature):
40
38
 
41
39
 
42
40
not_running_as_root = _NotRunningAsRoot()
43
 
 
44
41
apport = tests.ModuleAvailableFeature('apport')
45
 
lzma = tests.ModuleAvailableFeature('lzma')
46
 
meliae = tests.ModuleAvailableFeature('meliae')
47
42
paramiko = tests.ModuleAvailableFeature('paramiko')
48
43
pycurl = tests.ModuleAvailableFeature('pycurl')
49
44
pywintypes = tests.ModuleAvailableFeature('pywintypes')
 
45
subunit = tests.ModuleAvailableFeature('subunit')
50
46
sphinx = tests.ModuleAvailableFeature('sphinx')
51
 
subunit = tests.ModuleAvailableFeature('subunit')
52
47
 
53
48
 
54
49
class _BackslashDirSeparatorFeature(tests.Feature):
117
112
        return self._path
118
113
 
119
114
    def _probe(self):
120
 
        self._path = osutils.find_executable_on_path(self.name)
121
 
        return self._path is not None
 
115
        path = os.environ.get('PATH')
 
116
        if path is None:
 
117
            return False
 
118
        for d in path.split(os.pathsep):
 
119
            if d:
 
120
                f = os.path.join(d, self.name)
 
121
                if os.access(f, os.X_OK):
 
122
                    self._path = f
 
123
                    return True
 
124
        return False
122
125
 
123
126
    def feature_name(self):
124
127
        return '%s executable' % self.name