Переглянути джерело

add trivial tests for DiskObjectStore.add_{thin_,}pack.

Jelmer Vernooij 14 роки тому
батько
коміт
c4afce386b
1 змінених файлів з 18 додано та 0 видалено
  1. 18 0
      dulwich/tests/test_object_store.py

+ 18 - 0
dulwich/tests/test_object_store.py

@@ -33,6 +33,9 @@ from dulwich.object_store import (
     DiskObjectStore,
     MemoryObjectStore,
     )
+from dulwich.pack import (
+    write_pack_data,
+    )
 from dulwich.tests import (
     TestCase,
     )
@@ -163,4 +166,19 @@ class DiskObjectStoreTests(PackBasedObjectStoreTests, TestCase):
         o = DiskObjectStore(self.store_dir)
         self.assertEquals(os.path.join(self.store_dir, "pack"), o.pack_dir)
 
+    def test_add_pack(self):
+        o = DiskObjectStore(self.store_dir)
+        f, commit = o.add_pack()
+        b = make_object(Blob, data="more yummy data")
+        write_pack_data(f, [(b, None)], 1)
+        commit()
+
+    def test_add_thin_pack(self):
+        o = DiskObjectStore(self.store_dir)
+        f, commit = o.add_thin_pack()
+        b = make_object(Blob, data="more yummy data")
+        write_pack_data(f, [(b, None)], 1)
+        commit()
+
+
 # TODO: MissingObjectFinderTests