~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/features.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-21 13:36:51 UTC
  • mfrom: (5243.2.1 readdir_cleanup)
  • Revision ID: pqm@pqm.ubuntu.com-20100521133651-p62dndo2giy5ls21
(lifeless) Some cleanups to the readdir pyrex code for a little efficiency
 and to avoid compile warnings. (John A Meinel)

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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
 
17
"""A collection of commonly used 'Features' which bzrlib uses to skip tests."""
 
18
 
17
19
import os
18
20
import stat
19
21
 
24
26
apport = tests.ModuleAvailableFeature('apport')
25
27
paramiko = tests.ModuleAvailableFeature('paramiko')
26
28
pycurl = tests.ModuleAvailableFeature('pycurl')
 
29
pywintypes = tests.ModuleAvailableFeature('pywintypes')
27
30
subunit = tests.ModuleAvailableFeature('subunit')
28
31
 
29
32
 
 
33
class _BackslashDirSeparatorFeature(tests.Feature):
 
34
 
 
35
    def _probe(self):
 
36
        try:
 
37
            os.lstat(os.getcwd() + '\\')
 
38
        except OSError:
 
39
            return False
 
40
        else:
 
41
            return True
 
42
 
 
43
    def feature_name(self):
 
44
        return "Filesystem treats '\\' as a directory separator."
 
45
 
 
46
backslashdir_feature = _BackslashDirSeparatorFeature()
 
47
 
 
48
 
30
49
class _PosixPermissionsFeature(tests.Feature):
31
50
 
32
51
    def _probe(self):