/brz/remove-bazaar

To get this branch, use:
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
2729.2.5 by Martin Pool
Move per-inventory tests from test_inv to tests.inventory_implementations
19
# NOTE: Don't import Inventory here, to make sure that we don't accidentally
20
# hardcode that when we should be using self.make_inventory
21
22
from bzrlib import (
23
        errors,
24
        )
2729.2.1 by Martin Pool
Start adding per-inventory tests
25
26
from bzrlib.inventory import (
2729.2.5 by Martin Pool
Move per-inventory tests from test_inv to tests.inventory_implementations
27
        InventoryDirectory,
28
        InventoryEntry,
29
        InventoryFile,
30
        InventoryLink,
31
        ROOT_ID,
32
        TreeReference,
33
        )
2729.2.1 by Martin Pool
Start adding per-inventory tests
34
35
from bzrlib.tests import (
2729.2.5 by Martin Pool
Move per-inventory tests from test_inv to tests.inventory_implementations
36
        TestCase,
37
        multiply_tests_from_modules,
38
        )
2729.2.1 by Martin Pool
Start adding per-inventory tests
39
40
41
def _inventory_test_scenarios():
42
    """Return a sequence of test scenarios.
43
44
    Each scenario is (scenario_name_suffix, params).  The params are each 
45
    set as attributes on the test case.
46
    """
2729.2.5 by Martin Pool
Move per-inventory tests from test_inv to tests.inventory_implementations
47
    from bzrlib.inventory import (
48
        Inventory,
49
        )
2729.2.2 by Martin Pool
Start moving inventory tests into per-inventory module
50
    yield ('Inventory', dict(inventory_class=Inventory))
2729.2.1 by Martin Pool
Start adding per-inventory tests
51
52
53
def test_suite():
54
    """Generate suite containing all parameterized tests"""
55
    modules_to_test = [
2729.2.9 by Martin Pool
Move actual tests from inventory_implementations __init__ into basics.py (Aaron)
56
            'bzrlib.tests.inventory_implementations.basics',
2729.2.1 by Martin Pool
Start adding per-inventory tests
57
            ]
58
    return multiply_tests_from_modules(modules_to_test,
59
            _inventory_test_scenarios())