1 # test_object_store.py -- tests for object_store.py
2 # Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org>
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; version 2
7 # or (at your option) any later version of the License.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 from dulwich.object_store import ObjectStore
20 from unittest import TestCase
22 class ObjectStoreTests(TestCase):
24 def test_pack_dir(self):
25 o = ObjectStore("foo")
26 self.assertEquals("foo/pack", o.pack_dir())
28 def test_empty_packs(self):
29 o = ObjectStore("foo")
30 self.assertEquals([], o.packs)
32 def test_add_objects_empty(self):
33 o = ObjectStore("foo")
36 def test_add_commit(self):
37 o = ObjectStore("foo")
38 # TODO: Argh, no way to construct Git commit objects without
39 # access to a serialized form.