~ubuntu-branches/ubuntu/karmic/dulwich/karmic

« back to all changes in this revision

Viewing changes to dulwich/tests/test_object_store.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2009-05-10 16:18:27 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090510161827-29ypzfwubbkm9tog
Tags: 0.3.0-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
from unittest import TestCase
20
20
 
21
 
from dulwich.object_store import ObjectStore
 
21
from dulwich.object_store import (
 
22
    DiskObjectStore,
 
23
    MemoryObjectStore,
 
24
    )
22
25
 
23
 
class ObjectStoreTests(TestCase):
 
26
class DiskObjectStoreTests(TestCase):
24
27
 
25
28
    def test_pack_dir(self):
26
 
        o = ObjectStore("foo")
 
29
        o = DiskObjectStore("foo")
27
30
        self.assertEquals("foo/pack", o.pack_dir)
28
31
 
29
32
    def test_empty_packs(self):
30
 
        o = ObjectStore("foo")
 
33
        o = DiskObjectStore("foo")
31
34
        self.assertEquals([], o.packs)
32
35
 
33
36
    def test_add_objects_empty(self):
34
 
        o = ObjectStore("foo")
 
37
        o = DiskObjectStore("foo")
35
38
        o.add_objects([])
36
39
 
37
40
    def test_add_commit(self):
38
 
        o = ObjectStore("foo")
 
41
        o = DiskObjectStore("foo")
39
42
        # TODO: Argh, no way to construct Git commit objects without 
40
43
        # access to a serialized form.
41
44
        o.add_objects([])
 
45
 
 
46
 
 
47
class MemoryObjectStoreTests(TestCase):
 
48
 
 
49
    def test_iter(self):
 
50
        store = MemoryObjectStore()
 
51
        self.assertEquals([], list(store))