~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_repository.py

  • Committer: Aaron Bentley
  • Date: 2006-04-19 01:23:36 UTC
  • mfrom: (1669 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1673.
  • Revision ID: aaron.bentley@utoronto.ca-20060419012336-a74d3d2ea435d15f
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
195
195
        # regardless of contents
196
196
        self.assertFalse(t.has('lock/held/info'))
197
197
        repo.lock_write()
198
 
        self.assertTrue(t.has('lock/held/info'))
 
198
        try:
 
199
            self.assertTrue(t.has('lock/held/info'))
 
200
        finally:
 
201
            # unlock so we don't get a warning about failing to do so
 
202
            repo.unlock()
199
203
 
200
204
    def test_uses_lockdir(self):
201
205
        """repo format 7 actually locks on lockdir"""
262
266
        self.assertTrue(S_ISDIR(t.stat('knits').st_mode))
263
267
        self.check_knits(t)
264
268
 
 
269
    def assertHasKnit(self, t, knit_name):
 
270
        """Assert that knit_name exists on t."""
 
271
        self.assertEqualDiff('# bzr knit index 7\n',
 
272
                             t.get(knit_name + '.kndx').read())
 
273
        # no default content
 
274
        self.assertTrue(t.has(knit_name + '.knit'))
 
275
 
265
276
    def check_knits(self, t):
266
277
        """check knit content for a repository."""
267
 
        self.assertEqualDiff('# bzr knit index 7\n',
268
 
                             t.get('inventory.kndx').read())
269
 
        # no default content
270
 
        self.assertTrue(t.has('inventory.knit'))
271
 
        self.assertEqualDiff('# bzr knit index 7\n',
272
 
                             t.get('revisions.kndx').read())
273
 
        # no default content
274
 
        self.assertTrue(t.has('revisions.knit'))
275
 
        self.assertEqualDiff('# bzr knit index 7\n',
276
 
                             t.get('signatures.kndx').read())
277
 
        # no default content
278
 
        self.assertTrue(t.has('signatures.knit'))
 
278
        self.assertHasKnit(t, 'inventory')
 
279
        self.assertHasKnit(t, 'revisions')
 
280
        self.assertHasKnit(t, 'signatures')
279
281
 
280
282
    def test_shared_disk_layout(self):
281
283
        control = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())