~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/features.py

  • Committer: Vincent Ladeuil
  • Date: 2010-09-27 07:24:54 UTC
  • mfrom: (4797.58.18 2.1)
  • mto: (5050.17.26 2.2)
  • mto: This revision was merged to the branch mainline in revision 5448.
  • Revision ID: v.ladeuil+lp@free.fr-20100927072454-d47ejtl535tuggte
Merge lp:bzr/2.1 into 2.2 resolving conflicts

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