~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_inv.py

  • Committer: Jelmer Vernooij
  • Date: 2010-12-20 11:57:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5577.
  • Revision ID: jelmer@samba.org-20101220115714-2ru3hfappjweeg7q
Don't use no-plugins.

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.
589
592
        self.assertFalse(inv.is_root('TREE_ROOT'))
590
593
        self.assertFalse(inv.is_root('booga'))
591
594
 
 
595
    def test_entries_for_empty_inventory(self):
 
596
        """Test that entries() will not fail for an empty inventory"""
 
597
        inv = Inventory(root_id=None)
 
598
        self.assertEqual([], inv.entries())
 
599
 
592
600
 
593
601
class TestInventoryEntry(TestCase):
594
602