~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/features.py

  • Committer: John Arbash Meinel
  • Date: 2010-09-25 20:36:33 UTC
  • mto: This revision was merged to the branch mainline in revision 5445.
  • Revision ID: john@arbash-meinel.com-20100925203633-y0ipdyceuupti08w
Have to handle when details is None

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