66
77from lib import *
88from git import *
9- from git import IStream
10- from git .test .test_commit import assert_commit_serialization
9+ from git . base import IStream
10+ from git .test .objects . test_commit import assert_commit_serialization
1111from cStringIO import StringIO
1212from time import time
1313import sys
1414
1515class TestPerformance (TestBigRepoRW ):
16-
16+
1717 # ref with about 100 commits in its history
18- ref_100 = '0.1.6 '
18+ ref_100 = 'v0.99 '
1919
2020 def _query_commit_info (self , c ):
2121 c .author
@@ -45,13 +45,14 @@ def test_iteration(self):
4545 # END for each object
4646 # END for each commit
4747 elapsed_time = time () - st
48+ assert no , "Should have traversed a few objects"
4849 print >> sys .stderr , "Traversed %i Trees and a total of %i unchached objects in %s [s] ( %f objs/s )" % (nc , no , elapsed_time , no / elapsed_time )
4950
5051 def test_commit_traversal (self ):
5152 # bound to cat-file parsing performance
5253 nc = 0
5354 st = time ()
54- for c in self .gitrorepo .commit (self .head_sha_2k ).traverse (branch_first = False ):
55+ for c in self .rorepo .commit (self .head_sha_2k ).traverse (branch_first = False ):
5556 nc += 1
5657 self ._query_commit_info (c )
5758 # END for each traversed commit
@@ -62,7 +63,7 @@ def test_commit_iteration(self):
6263 # bound to stream parsing performance
6364 nc = 0
6465 st = time ()
65- for c in Commit .iter_items (self .gitrorepo , self .head_sha_2k ):
66+ for c in Commit .iter_items (self .rorepo , self .head_sha_2k ):
6667 nc += 1
6768 self ._query_commit_info (c )
6869 # END for each traversed commit
@@ -73,7 +74,7 @@ def test_commit_serialization(self):
7374 assert_commit_serialization (self .rwrepo , self .head_sha_2k , True )
7475
7576 rwrepo = self .rwrepo
76- make_object = rwrepo .odb . store
77+ make_object = rwrepo .store
7778 # direct serialization - deserialization can be tested afterwards
7879 # serialization is probably limited on IO
7980 hc = rwrepo .commit (self .head_sha_2k )
0 commit comments