/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/inventory_implementations/__init__.py

  • Committer: Martin Pool
  • Date: 2007-08-21 05:02:07 UTC
  • mto: This revision was merged to the branch mainline in revision 2779.
  • Revision ID: mbp@sourcefrog.net-20070821050207-ys2rrhoo0pud4isl
Start moving inventory tests into per-inventory module

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
28
28
 
29
29
 
30
30
class TestInventoryBasics(TestCase):
 
31
    # Most of these were moved the rather old bzrlib.tests.test_inv module
31
32
    
32
 
    def test_construction(self):
33
 
        pass
 
33
    def make_inventory(self, root_id):
 
34
        return self.inventory_class(root_id=root_id)
 
35
 
 
36
    def test_add_path_of_root(self):
 
37
        # add a root entry by adding its path
 
38
        inv = self.make_inventory(root_id=None)
 
39
        self.assertIs(None, inv.root)
 
40
        ie = inv.add_path("", "directory", "my-root")
 
41
        self.assertEqual("my-root", ie.file_id)
 
42
        self.assertIs(ie, inv.root)
 
43
 
 
44
    def test_add_path(self):
 
45
        inv = self.make_inventory(root_id='tree_root')
 
46
        ie = inv.add_path('hello', 'file', 'hello-id')
 
47
        self.assertEqual('hello-id', ie.file_id)
 
48
        self.assertEqual('file', ie.kind)
34
49
 
35
50
 
36
51
def _inventory_test_scenarios():
39
54
    Each scenario is (scenario_name_suffix, params).  The params are each 
40
55
    set as attributes on the test case.
41
56
    """
42
 
    yield 'Inventory', dict(inventory_class=Inventory)
 
57
    yield ('Inventory', dict(inventory_class=Inventory))
43
58
 
44
59
 
45
60
def test_suite():
47
62
    modules_to_test = [
48
63
            'bzrlib.tests.inventory_implementations',
49
64
            ]
 
65
    import pdb;pdb.set_trace()
50
66
    return multiply_tests_from_modules(modules_to_test,
51
67
            _inventory_test_scenarios())