~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_inv.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-12-10 00:12:42 UTC
  • mfrom: (5559.2.2 test-scenarios)
  • Revision ID: pqm@pqm.ubuntu.com-20101210001242-kc09e5hy8yfoaelj
(mbp) change ad-hoc test loading to load_tests_apply_scenarios (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    TestCaseWithTransport,
33
33
    condition_isinstance,
34
34
    multiply_tests,
35
 
    split_suite_by_condition,
36
35
    )
37
36
from bzrlib.tests.per_workingtree import workingtree_formats
38
 
 
39
 
 
40
 
def load_tests(standard_tests, module, loader):
41
 
    """Parameterise some inventory tests."""
42
 
    to_adapt, result = split_suite_by_condition(standard_tests,
43
 
        condition_isinstance(TestDeltaApplication))
 
37
from bzrlib.tests.scenarios import load_tests_apply_scenarios
 
38
 
 
39
 
 
40
load_tests = load_tests_apply_scenarios
 
41
 
 
42
 
 
43
def delta_application_scenarios():
44
44
    scenarios = [
45
45
        ('Inventory', {'apply_delta':apply_inventory_Inventory}),
46
46
        ]
63
63
            (str(format.__class__.__name__) + ".apply_inventory_delta", {
64
64
            'apply_delta':apply_inventory_WT,
65
65
            'format':format}))
66
 
    return multiply_tests(to_adapt, scenarios, result)
 
66
    return scenarios
67
67
 
68
68
 
69
69
def create_texts_for_inv(repo, inv):
73
73
        else:
74
74
            lines = []
75
75
        repo.texts.add_lines((ie.file_id, ie.revision), [], lines)
 
76
 
76
77
    
77
78
def apply_inventory_Inventory(self, basis, delta):
78
79
    """Apply delta to basis and return the result.
329
330
 
330
331
 
331
332
class TestDeltaApplication(TestCaseWithTransport):
 
333
 
 
334
    scenarios = delta_application_scenarios()
332
335
 
333
336
    def get_empty_inventory(self, reference_inv=None):
334
337
        """Get an empty inventory.