diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-04 14:41:15 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-04 14:41:15 +0200 |
commit | a1e80445ad5cb6da4c0070d7cb8af89da3b0803b (patch) | |
tree | ff94069b9d49d5a06576a0838a1bbde1e8c992ae /test | |
parent | b01ca6a3e4ae9d944d799743c8ff774e2a7a82b6 (diff) | |
download | gitpython-a1e80445ad5cb6da4c0070d7cb8af89da3b0803b.tar.gz |
initial version of new odb design to facilitate a channel based multi-threading implementation of all odb functions
Diffstat (limited to 'test')
-rw-r--r-- | test/git/performance/test_commit.py | 2 | ||||
-rw-r--r-- | test/git/performance/test_streams.py | 6 | ||||
-rw-r--r-- | test/git/test_commit.py | 4 | ||||
-rw-r--r-- | test/git/test_odb.py | 10 |
4 files changed, 11 insertions, 11 deletions
diff --git a/test/git/performance/test_commit.py b/test/git/performance/test_commit.py index 2398c93d..bca3ad8b 100644 --- a/test/git/performance/test_commit.py +++ b/test/git/performance/test_commit.py @@ -72,7 +72,7 @@ class TestPerformance(TestBigRepoRW): assert_commit_serialization(self.gitrwrepo, self.head_sha_2k, True) rwrepo = self.gitrwrepo - make_object = rwrepo.odb.to_object + make_object = rwrepo.odb.store # direct serialization - deserialization can be tested afterwards # serialization is probably limited on IO hc = rwrepo.commit(self.head_sha_2k) diff --git a/test/git/performance/test_streams.py b/test/git/performance/test_streams.py index d31bee14..30fd8048 100644 --- a/test/git/performance/test_streams.py +++ b/test/git/performance/test_streams.py @@ -51,7 +51,7 @@ class TestObjDBPerformance(TestBigRepoR): # writing - due to the compression it will seem faster than it is st = time() - sha = ldb.to_object('blob', size, stream) + sha = ldb.store('blob', size, stream) elapsed_add = time() - st assert ldb.has_object(sha) db_file = ldb.readable_db_object_path(sha) @@ -63,7 +63,7 @@ class TestObjDBPerformance(TestBigRepoR): # reading all at once st = time() - type, size, shastream = ldb.object(sha) + type, size, shastream = ldbstreamsha) shadata = shastream.read() elapsed_readall = time() - st @@ -76,7 +76,7 @@ class TestObjDBPerformance(TestBigRepoR): cs = 512*1000 chunks = list() st = time() - type, size, shastream = ldb.object(sha) + type, size, shastream = ldbstreamsha) while True: data = shastream.read(cs) chunks.append(data) diff --git a/test/git/test_commit.py b/test/git/test_commit.py index a5f184e6..e914b9a7 100644 --- a/test/git/test_commit.py +++ b/test/git/test_commit.py @@ -31,7 +31,7 @@ def assert_commit_serialization(rwrepo, commit_id, print_performance_info=False) streamlen = stream.tell() stream.seek(0) - csha = rwrepo.odb.to_object(Commit.type, streamlen, stream) + csha = rwrepo.odb.store(Commit.type, streamlen, stream) assert csha == cm.sha nc = Commit(rwrepo, Commit.NULL_HEX_SHA, cm.tree.sha, @@ -45,7 +45,7 @@ def assert_commit_serialization(rwrepo, commit_id, print_performance_info=False) ns += 1 streamlen = stream.tell() stream.seek(0) - nc.sha = rwrepo.odb.to_object(Commit.type, streamlen, stream) + nc.sha = rwrepo.odb.store(Commit.type, streamlen, stream) # if it worked, we have exactly the same contents ! assert nc.sha == cm.sha diff --git a/test/git/test_odb.py b/test/git/test_odb.py index b2840719..80597df6 100644 --- a/test/git/test_odb.py +++ b/test/git/test_odb.py @@ -18,26 +18,26 @@ class TestDB(TestBase): all_data = (two_lines, ) def _assert_object_writing(self, db): - """General tests to verify object writing, compatible to iObjectDBW + """General tests to verify object writing, compatible to ObjectDBW :note: requires write access to the database""" # start in dry-run mode for dry_run in range(1, -1, -1): for data in self.all_data: for hex_sha in range(2): - sha = db.to_object(Blob.type, len(data), StringIO(data), dry_run, hex_sha) + sha = db.store(Blob.type, len(data), StringIO(data), dry_run, hex_sha) assert db.has_object(sha) != dry_run assert len(sha) == 20 + hex_sha * 20 # verify data - the slow way, we want to run code if not dry_run: - type, size = db.object_info(sha) + type, size = db.info(sha) assert Blob.type == type assert size == len(data) - type, size, stream = db.object(sha) + type, size, stream = dbstreamsha) assert stream.read() == data else: - self.failUnlessRaises(BadObject, db.object_info, sha) + self.failUnlessRaises(BadObject, db.info, sha) self.failUnlessRaises(BadObject, db.object, sha) # END for each sha type # END for each data set |