~jelmer/dulwich/lp-pqm

« back to all changes in this revision

Viewing changes to dulwich/tests/test_object_store.py

  • Committer: Jelmer Vernooij
  • Date: 2012-02-01 22:13:51 UTC
  • mfrom: (413.11.554)
  • Revision ID: jelmer@samba.org-20120201221351-b3n2p9zttzh62dwu
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
270
270
          (REF_DELTA, (blob.id, 'more yummy data')),
271
271
          ], store=o)
272
272
        pack = o.add_thin_pack(f.read, None)
273
 
 
274
 
        packed_blob_sha = sha_to_hex(entries[0][3])
275
 
        pack.check_length_and_checksum()
276
 
        self.assertEqual(sorted([blob.id, packed_blob_sha]), list(pack))
277
 
        self.assertTrue(o.contains_packed(packed_blob_sha))
278
 
        self.assertTrue(o.contains_packed(blob.id))
279
 
        self.assertEqual((Blob.type_num, 'more yummy data'),
280
 
                         o.get_raw(packed_blob_sha))
281
 
 
 
273
        try:
 
274
            packed_blob_sha = sha_to_hex(entries[0][3])
 
275
            pack.check_length_and_checksum()
 
276
            self.assertEqual(sorted([blob.id, packed_blob_sha]), list(pack))
 
277
            self.assertTrue(o.contains_packed(packed_blob_sha))
 
278
            self.assertTrue(o.contains_packed(blob.id))
 
279
            self.assertEqual((Blob.type_num, 'more yummy data'),
 
280
                             o.get_raw(packed_blob_sha))
 
281
        finally:
 
282
            # FIXME: DiskObjectStore should have close() which do the following:
 
283
            for p in o._pack_cache or []:
 
284
                p.close()
 
285
 
 
286
            pack.close()
282
287
 
283
288
class TreeLookupPathTests(TestCase):
284
289