/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
0.64.1 by Ian Clatworthy
1st cut: gfi parser + --info processing method
1
# Copyright (C) 2008 Canonical Limited.
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; version 2 of the License.
6
#
7
# This program is distributed in the hope that it will be useful,
8
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
# GNU General Public License for more details.
11
#
12
# You should have received a copy of the GNU General Public License
0.64.334 by Jelmer Vernooij
Remove old FSF address. Thanks Dan Callaghan.
13
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
0.64.1 by Ian Clatworthy
1st cut: gfi parser + --info processing method
14
#
15
16
"""Tests for bzr-fastimport."""
17
18
0.123.12 by Jelmer Vernooij
Add FastimportFeature.
19
from bzrlib import errors as bzr_errors
0.64.325 by Jelmer Vernooij
Cope with Feature only being available from bzrlib.tests.features.
20
from bzrlib.tests import TestLoader
0.64.326 by Jelmer Vernooij
Cope with older versions of bzr.
21
try:
22
    from bzrlib.tests.features import Feature
23
except ImportError: # bzr < 2.5
24
    from bzrlib.tests import Feature
0.123.12 by Jelmer Vernooij
Add FastimportFeature.
25
from bzrlib.plugins.fastimport import load_fastimport
26
27
28
class _FastimportFeature(Feature):
29
30
    def _probe(self):
31
        try:
32
            load_fastimport()
33
        except bzr_errors.DependencyNotPresent:
34
            return False
35
        return True
36
37
    def feature_name(self):
38
        return 'fastimport'
39
40
41
FastimportFeature = _FastimportFeature()
42
0.64.1 by Ian Clatworthy
1st cut: gfi parser + --info processing method
43
44
45
def test_suite():
0.123.2 by Jelmer Vernooij
Split out fastimport, import it from the system.
46
    module_names = [__name__ + '.' + x for x in [
0.64.281 by Jelmer Vernooij
Add tests for _get_source_stream.
47
        'test_commands',
0.64.282 by Jelmer Vernooij
Fix output stream to stdout for bzr fast-export.
48
        'test_exporter',
0.123.2 by Jelmer Vernooij
Split out fastimport, import it from the system.
49
        'test_branch_mapper',
50
        'test_generic_processor',
51
        'test_revision_store',
0.115.12 by John Arbash Meinel
Add a bunch of direct tests for the _TreeShim interface.
52
        ]]
0.64.1 by Ian Clatworthy
1st cut: gfi parser + --info processing method
53
    loader = TestLoader()
54
    return loader.loadTestsFromModuleNames(module_names)