summaryrefslogtreecommitdiff
path: root/test/git/performance/test_streams.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-04 23:06:31 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-04 23:06:31 +0200
commita243827ab3346e188e99db2f9fc1f916941c9b1a (patch)
treee0111a983c83efb616dcbbe9aa453d5c54b3b90e /test/git/performance/test_streams.py
parent6fbb69306c0e14bacb8dcb92a89af27d3d5d631f (diff)
downloadgitpython-a243827ab3346e188e99db2f9fc1f916941c9b1a.tar.gz
Implemented stream tests, found a bug on the way, slowly a test-framework for streams starts to show up, but its not yet there
Diffstat (limited to 'test/git/performance/test_streams.py')
-rw-r--r--test/git/performance/test_streams.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/test/git/performance/test_streams.py b/test/git/performance/test_streams.py
index 01ec9fc4..8f600cb3 100644
--- a/test/git/performance/test_streams.py
+++ b/test/git/performance/test_streams.py
@@ -3,13 +3,11 @@
from test.testlib import *
from git.odb import *
-from array import array
from cStringIO import StringIO
from time import time
import os
import sys
import stat
-import random
import subprocess
@@ -18,18 +16,11 @@ from lib import (
)
-
def make_memory_file(size_in_bytes, randomize=False):
""":return: tuple(size_of_stream, stream)
:param randomize: try to produce a very random stream"""
- actual_size = size_in_bytes / 4
- producer = xrange(actual_size)
- if randomize:
- producer = list(producer)
- random.shuffle(producer)
- # END randomize
- a = array('i', producer)
- return actual_size*4, StringIO(a.tostring())
+ d = make_bytes(size_in_bytes, randomize)
+ return len(d), StringIO(d)
class TestObjDBPerformance(TestBigRepoR):