Add FastimportFeature.
[bzr-fastimport.git] / tests / __init__.py
blob1bd9633169e736f6423ad94aafa5937a74148b1b
1 # Copyright (C) 2008 Canonical Limited.
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.
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.
12 # You should have received a copy of the GNU General Public License
13 # along with this program; if not, write to the Free Software
14 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 """Tests for bzr-fastimport."""
20 from bzrlib import errors as bzr_errors
21 from bzrlib.tests import Feature, TestLoader
22 from bzrlib.plugins.fastimport import load_fastimport
25 class _FastimportFeature(Feature):
27 def _probe(self):
28 try:
29 load_fastimport()
30 except bzr_errors.DependencyNotPresent:
31 return False
32 return True
34 def feature_name(self):
35 return 'fastimport'
38 FastimportFeature = _FastimportFeature()
42 def test_suite():
43 module_names = [__name__ + '.' + x for x in [
44 'test_branch_mapper',
45 'test_generic_processor',
46 'test_revision_store',
48 loader = TestLoader()
49 return loader.loadTestsFromModuleNames(module_names)