~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-08-18 01:29:12 UTC
  • mfrom: (5377.3.1 trivial)
  • Revision ID: pqm@pqm.ubuntu.com-20100818012912-wwgerzeui5ldf5lh
(mbp) slightly better error handling in ftp transport (Martin Pool)

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()
41
26
apport = tests.ModuleAvailableFeature('apport')
42
27
paramiko = tests.ModuleAvailableFeature('paramiko')
43
28
pycurl = tests.ModuleAvailableFeature('pycurl')
129
114
 
130
115
bash_feature = ExecutableFeature('bash')
131
116
sed_feature = ExecutableFeature('sed')
132
 
diff_feature = ExecutableFeature('diff')