~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/features.py

  • Committer: toto at example
  • Date: 2010-09-27 19:31:45 UTC
  • mfrom: (5050.17.27 2.2)
  • mto: This revision was merged to the branch mainline in revision 5448.
  • Revision ID: toto@example.com-20100927193145-bly1dw5wjd23hiwy
Merge lp:bzr/2.2 into trunk including fixes for #644855, #646133, #632387

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