From 15dd52cd578691930cea194e003fa80dd02f40eb Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Sun, 9 Feb 2014 21:23:51 +0100 Subject: tabs to 4 spaces - overall state of this branch is desolate, but fixable. Needs plenty of work --- git/test/performance/lib.py | 94 ++++++++++++++++++++++----------------------- 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'git/test/performance/lib.py') diff --git a/git/test/performance/lib.py b/git/test/performance/lib.py index 758d402d..c82ccb16 100644 --- a/git/test/performance/lib.py +++ b/git/test/performance/lib.py @@ -1,9 +1,9 @@ """Contains library functions""" import os from git.test.lib import ( - TestBase, - GlobalsItemDeletorMetaCls - ) + TestBase, + GlobalsItemDeletorMetaCls + ) import shutil import tempfile @@ -16,12 +16,12 @@ k_env_git_repo = "GIT_PYTHON_TEST_GIT_REPO_BASE" #{ 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 + """: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 @@ -29,46 +29,46 @@ def resolve_or_fail(env_var): #{ Base Classes class TestBigRepoR(TestBase): - """TestCase providing access to readonly 'big' repositories using the following - member variables: - - * gitrorepo - - * a big read-only git repository + """TestCase providing access to readonly 'big' repositories using the following + member variables: + + * gitrorepo + + * a big read-only git repository """ - - #{ Invariants - head_sha_2k = '235d521da60e4699e5bd59ac658b5b48bd76ddca' - head_sha_50 = '32347c375250fd470973a5d76185cac718955fd5' - #} END invariants - - #{ Configuration - RepoCls = Repo - #} END configuration - - @classmethod - def setUpAll(cls): - super(TestBigRepoR, cls).setUpAll() - if cls.RepoCls is None: - raise AssertionError("Require RepoCls in class %s to be set" % cls) - #END assert configuration - cls.rorepo = cls.RepoCls(resolve_or_fail(k_env_git_repo)) + + #{ Invariants + head_sha_2k = '235d521da60e4699e5bd59ac658b5b48bd76ddca' + head_sha_50 = '32347c375250fd470973a5d76185cac718955fd5' + #} END invariants + + #{ Configuration + RepoCls = Repo + #} END configuration + + @classmethod + def setUpAll(cls): + super(TestBigRepoR, cls).setUpAll() + if cls.RepoCls is None: + raise AssertionError("Require RepoCls in class %s to be set" % cls) + #END assert configuration + cls.rorepo = cls.RepoCls(resolve_or_fail(k_env_git_repo)) class TestBigRepoRW(TestBigRepoR): - """As above, but provides a big repository that we can write to. - - Provides ``self.rwrepo``""" - - @classmethod - def setUpAll(cls): - super(TestBigRepoRW, cls).setUpAll() - dirname = tempfile.mktemp() - os.mkdir(dirname) - cls.rwrepo = cls.rorepo.clone(dirname, shared=True, bare=True) - - @classmethod - def tearDownAll(cls): - shutil.rmtree(cls.rwrepo.working_dir) - + """As above, but provides a big repository that we can write to. + + Provides ``self.rwrepo``""" + + @classmethod + def setUpAll(cls): + super(TestBigRepoRW, cls).setUpAll() + dirname = tempfile.mktemp() + os.mkdir(dirname) + cls.rwrepo = cls.rorepo.clone(dirname, shared=True, bare=True) + + @classmethod + def tearDownAll(cls): + shutil.rmtree(cls.rwrepo.working_dir) + #} END base classes -- cgit v1.2.1