/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
4763.2.4 by John Arbash Meinel
merge bzr.2.1 in preparation for NEWS entry.
1
# Copyright (C) 2009, 2010 Canonical Ltd
4584.3.21 by Martin Pool
Start adding tests for apport
2
#
3
# This program is free software; you can redistribute it and/or modify
4
# it under the terms of the GNU General Public License as published by
5
# the Free Software Foundation; either version 2 of the License, or
6
# (at your option) any later version.
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
# GNU General Public License for more details.
12
#
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
4797.70.1 by Vincent Ladeuil
Skip chmodbits dependent tests when running as root
17
import os
4584.3.21 by Martin Pool
Start adding tests for apport
18
4913.2.11 by John Arbash Meinel
Convert a bunch more features over to ModuleAvailableFeature
19
from bzrlib import tests
4913.2.19 by John Arbash Meinel
Compatibly rename ApportFeature to features.apport.
20
from bzrlib.symbol_versioning import deprecated_in
21
22
4797.70.1 by Vincent Ladeuil
Skip chmodbits dependent tests when running as root
23
class _NotRunningAsRoot(tests.Feature):
24
25
    def _probe(self):
26
        try:
27
            uid = os.getuid()
28
        except AttributeError:
29
            # If there is no uid, chances are there is no root either
30
            return True
31
        return uid != 0
32
33
    def feature_name(self):
34
        return 'Not running as root'
35
36
37
not_running_as_root = _NotRunningAsRoot()
4913.2.19 by John Arbash Meinel
Compatibly rename ApportFeature to features.apport.
38
apport = tests.ModuleAvailableFeature('apport')
39
ApportFeature = tests._CompatabilityThunkFeature('bzrlib.tests.features',
40
    'ApportFeature', 'bzrlib.tests.features.apport', deprecated_in((2,1,0)))
4913.2.18 by John Arbash Meinel
Add a _CompatibilityThunkFeature.
41
paramiko = tests.ModuleAvailableFeature('paramiko')
4913.2.11 by John Arbash Meinel
Convert a bunch more features over to ModuleAvailableFeature
42
pycurl = tests.ModuleAvailableFeature('pycurl')
4913.2.18 by John Arbash Meinel
Add a _CompatibilityThunkFeature.
43
subunit = tests.ModuleAvailableFeature('subunit')