diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-02 16:13:32 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-02 16:13:32 +0200 |
commit | 4e1c89ec97ec90037583e85d0e9e71e9c845a19b (patch) | |
tree | e1ab3782a5d0f53a61e315221e51e5f820d440e9 /test/git/performance/lib.py | |
parent | 4a25347d7f4c371345da2348ac6cceec7a143da2 (diff) | |
download | gitpython-4e1c89ec97ec90037583e85d0e9e71e9c845a19b.tar.gz |
Added performance testing foundation library, reworked existing performance tests to work on larger repositories
Diffstat (limited to 'test/git/performance/lib.py')
-rw-r--r-- | test/git/performance/lib.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/git/performance/lib.py b/test/git/performance/lib.py new file mode 100644 index 00000000..4b552b20 --- /dev/null +++ b/test/git/performance/lib.py @@ -0,0 +1,46 @@ +"""Contains library functions""" +import os +from test.testlib import * + +from git import ( + Repo + ) + +#{ Invvariants +k_env_git_repo = "GIT_PYTHON_TEST_GIT_REPO_BASE" +#} END invariants + + +#{ Utilities +def resolve_or_fail(env_var): + """:return: resolved environment variable or raise EnvironmentError""" + try: + return os.environ[env_var] + except KeyError: + raise EnvironmentError("Please set the %r envrionment variable and retry" % env_var) + # END exception handling + +#} END utilities + + +#{ Base Classes + +class TestBigRepoReadOnly(TestBase): + """TestCase providing access to readonly 'big' repositories using the following + member variables: + + * gitrepo + + * Read-Only git repository - actually the repo of git itself""" + + #{ Invariants + head_sha_2k = '235d521da60e4699e5bd59ac658b5b48bd76ddca' + head_sha_50 = '32347c375250fd470973a5d76185cac718955fd5' + #} END invariants + + @classmethod + def setUpAll(cls): + super(TestBigRepoReadOnly, cls).setUpAll() + cls.gitrepo = Repo(resolve_or_fail(k_env_git_repo)) + +#} END base classes |