Merge lp:~johncarr/dulwich/git-serve
[jelmer/dulwich-libgit2.git] / dulwich / tests / test_object_store.py
1 # test_object_store.py -- tests for object_store.py
2 # Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org>
3
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.
8
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.
13
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,
17 # MA  02110-1301, USA.
18
19 from dulwich.object_store import ObjectStore
20 from unittest import TestCase
21
22 class ObjectStoreTests(TestCase):
23
24     def test_pack_dir(self):
25         o = ObjectStore("foo")
26         self.assertEquals("foo/pack", o.pack_dir())
27
28     def test_empty_packs(self):
29         o = ObjectStore("foo")
30         self.assertEquals([], o.packs)
31
32     def test_add_objects_empty(self):
33         o = ObjectStore("foo")
34         o.add_objects([])
35
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.
40         o.add_objects([])