~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: 2011-01-11 15:45:55 UTC
  • mfrom: (5588.1.1 bzr.dev)
  • Revision ID: pqm@pqm.ubuntu.com-20110111154555-xmu386vs0qoigyhl
(vila) Document the packaging helper scripts. (Max Bowsher)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    revision,
26
26
    tests,
27
27
    )
28
 
from bzrlib.inventory import (CHKInventory, Inventory, ROOT_ID, InventoryFile,
29
 
    InventoryDirectory, InventoryEntry, TreeReference)
 
28
from bzrlib.inventory import (
 
29
    CHKInventory,
 
30
    Inventory,
 
31
    ROOT_ID,
 
32
    InventoryFile,
 
33
    InventoryDirectory,
 
34
    InventoryEntry,
 
35
    TreeReference,
 
36
    )
30
37
from bzrlib.tests import (
31
38
    TestCase,
32
39
    TestCaseWithTransport,
33
 
    condition_isinstance,
34
 
    multiply_tests,
35
 
    split_suite_by_condition,
36
40
    )
37
41
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))
 
42
from bzrlib.tests.scenarios import load_tests_apply_scenarios
 
43
 
 
44
 
 
45
load_tests = load_tests_apply_scenarios
 
46
 
 
47
 
 
48
def delta_application_scenarios():
44
49
    scenarios = [
45
50
        ('Inventory', {'apply_delta':apply_inventory_Inventory}),
46
51
        ]
63
68
            (str(format.__class__.__name__) + ".apply_inventory_delta", {
64
69
            'apply_delta':apply_inventory_WT,
65
70
            'format':format}))
66
 
    return multiply_tests(to_adapt, scenarios, result)
 
71
    return scenarios
67
72
 
68
73
 
69
74
def create_texts_for_inv(repo, inv):
73
78
        else:
74
79
            lines = []
75
80
        repo.texts.add_lines((ie.file_id, ie.revision), [], lines)
 
81
 
76
82
    
77
83
def apply_inventory_Inventory(self, basis, delta):
78
84
    """Apply delta to basis and return the result.
329
335
 
330
336
 
331
337
class TestDeltaApplication(TestCaseWithTransport):
 
338
 
 
339
    scenarios = delta_application_scenarios()
332
340
 
333
341
    def get_empty_inventory(self, reference_inv=None):
334
342
        """Get an empty inventory.