/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
0.64.336 by Jelmer Vernooij
tests/__init__.py is GPLv2 *or later*, like the rest of bzr-fastimport.
5
# the Free Software Foundation; version 2 of the License or
6
# (at your option) any later version.
0.64.1 by Ian Clatworthy
1st cut: gfi parser + --info processing method
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
0.64.334 by Jelmer Vernooij
Remove old FSF address. Thanks Dan Callaghan.
14
# 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
15
#
16
17
"""Tests for bzr-fastimport."""
18
19
0.123.12 by Jelmer Vernooij
Add FastimportFeature.
20
from bzrlib import errors as bzr_errors
0.64.325 by Jelmer Vernooij
Cope with Feature only being available from bzrlib.tests.features.
21
from bzrlib.tests import TestLoader
0.64.326 by Jelmer Vernooij
Cope with older versions of bzr.
22
try:
23
    from bzrlib.tests.features import Feature
24
except ImportError: # bzr < 2.5
25
    from bzrlib.tests import Feature
0.123.12 by Jelmer Vernooij
Add FastimportFeature.
26
from bzrlib.plugins.fastimport import load_fastimport
27
28
29
class _FastimportFeature(Feature):
30
31
    def _probe(self):
32
        try:
33
            load_fastimport()
34
        except bzr_errors.DependencyNotPresent:
35
            return False
36
        return True
37
38
    def feature_name(self):
39
        return 'fastimport'
40
41
42
FastimportFeature = _FastimportFeature()
43
0.64.1 by Ian Clatworthy
1st cut: gfi parser + --info processing method
44
45
46
def test_suite():
0.123.2 by Jelmer Vernooij
Split out fastimport, import it from the system.
47
    module_names = [__name__ + '.' + x for x in [
0.64.281 by Jelmer Vernooij
Add tests for _get_source_stream.
48
        'test_commands',
0.64.282 by Jelmer Vernooij
Fix output stream to stdout for bzr fast-export.
49
        'test_exporter',
0.123.2 by Jelmer Vernooij
Split out fastimport, import it from the system.
50
        'test_branch_mapper',
51
        'test_generic_processor',
52
        'test_revision_store',
0.115.12 by John Arbash Meinel
Add a bunch of direct tests for the _TreeShim interface.
53
        ]]
0.64.1 by Ian Clatworthy
1st cut: gfi parser + --info processing method
54
    loader = TestLoader()
55
    return loader.loadTestsFromModuleNames(module_names)