~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-09-29 22:03:03 UTC
  • mfrom: (5416.2.6 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20100929220303-cr95h8iwtggco721
(mbp) Add 'break-lock --force'

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib.symbol_versioning import deprecated_in
24
24
 
25
25
 
 
26
class _NotRunningAsRoot(tests.Feature):
 
27
 
 
28
    def _probe(self):
 
29
        try:
 
30
            uid = os.getuid()
 
31
        except AttributeError:
 
32
            # If there is no uid, chances are there is no root either
 
33
            return True
 
34
        return uid != 0
 
35
 
 
36
    def feature_name(self):
 
37
        return 'Not running as root'
 
38
 
 
39
 
 
40
not_running_as_root = _NotRunningAsRoot()
26
41
apport = tests.ModuleAvailableFeature('apport')
27
42
paramiko = tests.ModuleAvailableFeature('paramiko')
28
43
pycurl = tests.ModuleAvailableFeature('pycurl')
29
44
pywintypes = tests.ModuleAvailableFeature('pywintypes')
30
45
subunit = tests.ModuleAvailableFeature('subunit')
 
46
sphinx = tests.ModuleAvailableFeature('sphinx')
31
47
 
32
48
 
33
49
class _BackslashDirSeparatorFeature(tests.Feature):
113
129
 
114
130
bash_feature = ExecutableFeature('bash')
115
131
sed_feature = ExecutableFeature('sed')
 
132
diff_feature = ExecutableFeature('diff')