~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_workingtree.py

Test the disk layout of format3 working trees.

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
        self.assertEqual(format.open(dir), workingtree.WorkingTree.open_downlevel('.'))
151
151
        # unregister the format
152
152
        workingtree.WorkingTreeFormat.unregister_format(format)
 
153
 
 
154
 
 
155
class TestWorkingTreeFormat3(TestCaseWithTransport):
 
156
    """Tests specific to WorkingTreeFormat3."""
 
157
 
 
158
    def test_disk_layout(self):
 
159
        control = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
 
160
        control.create_repository()
 
161
        control.create_branch()
 
162
        tree = workingtree.WorkingTreeFormat3().initialize(control)
 
163
        # we want:
 
164
        # format 'Bazaar-NG Working Tree format 3'
 
165
        # lock ''
 
166
        # inventory = blank inventory
 
167
        # pending-merges = ''
 
168
        # stat-cache = ??
 
169
        # no inventory.basis yet
 
170
        t = control.get_workingtree_transport(None)
 
171
        self.assertEqualDiff('Bazaar-NG Working Tree format 3',
 
172
                             t.get('format').read())
 
173
        self.assertEqualDiff('', t.get('lock').read())
 
174
        self.assertEqualDiff('<inventory format="5">\n'
 
175
                             '</inventory>\n',
 
176
                             t.get('inventory').read())
 
177
        self.assertEqualDiff('### bzr hashcache v5\n',
 
178
                             t.get('stat-cache').read())
 
179
        self.assertFalse(t.has('inventory.basis'))
 
180
        # TODO RBC 20060210 do a commit, check the inventory.basis is created 
 
181
        # correctly.