~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:
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')