summaryrefslogtreecommitdiff
path: root/git/test/db/py
diff options
context:
space:
mode:
Diffstat (limited to 'git/test/db/py')
-rw-r--r--git/test/db/py/test_git.py8
-rw-r--r--git/test/db/py/test_loose.py6
-rw-r--r--git/test/db/py/test_mem.py10
-rw-r--r--git/test/db/py/test_pack.py8
-rw-r--r--git/test/db/py/test_ref.py8
5 files changed, 23 insertions, 17 deletions
diff --git a/git/test/db/py/test_git.py b/git/test/db/py/test_git.py
index 524d4080..ecaa5c8f 100644
--- a/git/test/db/py/test_git.py
+++ b/git/test/db/py/test_git.py
@@ -3,7 +3,7 @@
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
from git.test.lib import rorepo_dir
-from git.test.db.lib import *
+from git.test.db.lib import TestDBBase, with_rw_directory
from git.exc import BadObject
from git.db.py.complex import PureGitODB
from git.base import OStream, OInfo
@@ -12,10 +12,10 @@ from git.util import hex_to_bin, bin_to_hex
import os
class TestGitDB(TestDBBase):
- RepoCls = PureGitODB
+ needs_ro_repo = False
def test_reading(self):
- gdb = self.RepoCls(os.path.join(rorepo_dir(), 'objects'))
+ gdb = PureGitODB(os.path.join(rorepo_dir(), 'objects'))
# we have packs and loose objects, alternates doesn't necessarily exist
assert 1 < len(gdb.databases()) < 4
@@ -44,7 +44,7 @@ class TestGitDB(TestDBBase):
@with_rw_directory
def test_writing(self, path):
- gdb = self.RepoCls(path)
+ gdb = PureGitODB(path)
# its possible to write objects
self._assert_object_writing(gdb)
diff --git a/git/test/db/py/test_loose.py b/git/test/db/py/test_loose.py
index eb18c05d..0c9b4831 100644
--- a/git/test/db/py/test_loose.py
+++ b/git/test/db/py/test_loose.py
@@ -2,18 +2,18 @@
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
-from git.test.db.lib import *
+from git.test.db.lib import TestDBBase, with_rw_directory
from git.db.py.loose import PureLooseObjectODB
from git.exc import BadObject
from git.util import bin_to_hex
class TestLooseDB(TestDBBase):
- RepoCls = PureLooseObjectODB
+ needs_ro_repo = False
@with_rw_directory
def test_basics(self, path):
- ldb = self.RepoCls(path)
+ ldb = PureLooseObjectODB(path)
# write data
self._assert_object_writing(ldb)
diff --git a/git/test/db/py/test_mem.py b/git/test/db/py/test_mem.py
index ed14cc21..bc98dc56 100644
--- a/git/test/db/py/test_mem.py
+++ b/git/test/db/py/test_mem.py
@@ -2,14 +2,14 @@
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
-from lib import *
-from git.db.py import (
- PureMemoryDB,
- PureLooseObjectODB
- )
+from git.test.db.lib import TestDBBase, with_rw_directory
+from git.db.py.mem import PureMemoryDB
+from git.db.py.loose import PureLooseObjectODB
class TestPureMemoryDB(TestDBBase):
+ needs_ro_repo = False
+
@with_rw_directory
def test_writing(self, path):
mdb = PureMemoryDB()
diff --git a/git/test/db/py/test_pack.py b/git/test/db/py/test_pack.py
index 4854c4e7..5043f446 100644
--- a/git/test/db/py/test_pack.py
+++ b/git/test/db/py/test_pack.py
@@ -2,8 +2,9 @@
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
-from lib import *
-from git.db.py import PurePackedODB
+from git.test.db.lib import TestDBBase, with_packs_rw
+
+from git.db.py.pack import PurePackedODB
from git.test.lib import fixture_path
from git.exc import BadObject, AmbiguousObjectName
@@ -13,12 +14,15 @@ import random
class TestPackDB(TestDBBase):
+ needs_ro_repo = False
+
@with_packs_rw
def test_writing(self, path):
pdb = PurePackedODB(path)
# on demand, we init our pack cache
num_packs = len(pdb.entities())
+ assert num_packs
assert pdb._st_mtime != 0
# test pack directory changed:
diff --git a/git/test/db/py/test_ref.py b/git/test/db/py/test_ref.py
index 43fbb48f..c5374dc9 100644
--- a/git/test/db/py/test_ref.py
+++ b/git/test/db/py/test_ref.py
@@ -2,8 +2,8 @@
#
# This module is part of GitDB and is released under
# the New BSD License: http://www.opensource.org/licenses/bsd-license.php
-from lib import *
-from git.db.py import PureReferenceDB
+from git.test.db.lib import *
+from git.db.py.ref import PureReferenceDB
from git.util import (
NULL_BIN_SHA,
@@ -14,6 +14,8 @@ import os
class TestPureReferenceDB(TestDBBase):
+ needs_ro_repo = False
+
def make_alt_file(self, alt_path, alt_list):
"""Create an alternates file which contains the given alternates.
The list can be empty"""
@@ -44,7 +46,7 @@ class TestPureReferenceDB(TestDBBase):
assert len(rdb.databases()) == 1
# we should now find a default revision of ours
- git_sha = hex_to_bin("5690fd0d3304f378754b23b098bd7cb5f4aa1976")
+ git_sha = hex_to_bin("5aebcd5cb3340fb31776941d7e4d518a712a8655")
assert rdb.has_object(git_sha)
# remove valid