|
@@ -0,0 +1,42 @@
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+from cStringIO import StringIO
|
|
|
+
|
|
|
+from dulwich.fastexport import FastExporter
|
|
|
+from dulwich.object_store import MemoryObjectStore
|
|
|
+from dulwich.objects import Blob
|
|
|
+
|
|
|
+from unittest import TestCase
|
|
|
+
|
|
|
+
|
|
|
+class FastExporterTests(TestCase):
|
|
|
+
|
|
|
+ def setUp(self):
|
|
|
+ super(FastExporterTests, self).setUp()
|
|
|
+ self.store = MemoryObjectStore()
|
|
|
+ self.stream = StringIO()
|
|
|
+ self.fastexporter = FastExporter(self.stream, self.store)
|
|
|
+
|
|
|
+ def test_export_blob(self):
|
|
|
+ b = Blob()
|
|
|
+ b.data = "fooBAR"
|
|
|
+ self.fastexporter.export_blob(b, 0)
|
|
|
+ self.assertEquals('blob\nmark :0\ndata 6\nfooBAR\n',
|
|
|
+ self.stream.getvalue())
|