bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
2729.2.2
by Martin Pool
Start moving inventory tests into per-inventory module |
1 |
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
|
|
2729.2.1
by Martin Pool
Start adding per-inventory tests |
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
16 |
||
17 |
"""Tests for different inventory implementations"""
|
|
18 |
||
19 |
from bzrlib.tests import ( |
|
|
2729.2.5
by Martin Pool
Move per-inventory tests from test_inv to tests.inventory_implementations |
20 |
multiply_tests_from_modules, |
21 |
)
|
|
|
2729.2.1
by Martin Pool
Start adding per-inventory tests |
22 |
|
23 |
||
24 |
def _inventory_test_scenarios(): |
|
25 |
"""Return a sequence of test scenarios. |
|
26 |
||
27 |
Each scenario is (scenario_name_suffix, params). The params are each
|
|
28 |
set as attributes on the test case.
|
|
29 |
"""
|
|
|
2729.2.5
by Martin Pool
Move per-inventory tests from test_inv to tests.inventory_implementations |
30 |
from bzrlib.inventory import ( |
31 |
Inventory, |
|
32 |
)
|
|
|
2729.2.2
by Martin Pool
Start moving inventory tests into per-inventory module |
33 |
yield ('Inventory', dict(inventory_class=Inventory)) |
|
2729.2.1
by Martin Pool
Start adding per-inventory tests |
34 |
|
35 |
||
|
3302.9.18
by Vincent Ladeuil
bzrlib.tests.inventory_implementations and |
36 |
def load_tests(basic_tests, module, loader): |
|
2729.2.1
by Martin Pool
Start adding per-inventory tests |
37 |
"""Generate suite containing all parameterized tests""" |
|
3302.9.18
by Vincent Ladeuil
bzrlib.tests.inventory_implementations and |
38 |
suite = loader.suiteClass() |
39 |
# add the tests for this module
|
|
40 |
suite.addTests(basic_tests) |
|
41 |
||
|
2729.2.1
by Martin Pool
Start adding per-inventory tests |
42 |
modules_to_test = [ |
|
3302.9.18
by Vincent Ladeuil
bzrlib.tests.inventory_implementations and |
43 |
'bzrlib.tests.inventory_implementations.basics', |
44 |
]
|
|
|
3302.9.27
by Vincent Ladeuil
Fixed as per Ian's review. |
45 |
# add the tests for the sub modules
|
|
3302.9.18
by Vincent Ladeuil
bzrlib.tests.inventory_implementations and |
46 |
suite.addTests(multiply_tests_from_modules(modules_to_test, |
47 |
_inventory_test_scenarios(), |
|
48 |
loader)) |
|
49 |
return suite |