diff --git a/kallithea/tests/base.py b/kallithea/tests/base.py --- a/kallithea/tests/base.py +++ b/kallithea/tests/base.py @@ -88,23 +88,25 @@ GIT_TEST_REVISION = u"7ab37bc680b4aa72c3 SCM_TESTS = ['hg', 'git'] uniq_suffix = str(int(time.mktime(datetime.datetime.now().timetuple()))) -GIT_REMOTE_REPO = 'git://github.com/codeinn/vcs.git' +GIT_REMOTE_REPO = os.path.join(TESTS_TMP_PATH, GIT_REPO) TEST_GIT_REPO = os.path.join(TESTS_TMP_PATH, GIT_REPO) -TEST_GIT_REPO_CLONE = os.path.join(TESTS_TMP_PATH, 'vcsgitclone%s' % uniq_suffix) -TEST_GIT_REPO_PULL = os.path.join(TESTS_TMP_PATH, 'vcsgitpull%s' % uniq_suffix) +TEST_GIT_REPO_CLONE = os.path.join(TESTS_TMP_PATH, 'vcs-git-clone-%s' % uniq_suffix) +TEST_GIT_REPO_PULL = os.path.join(TESTS_TMP_PATH, 'vcs-git-pull-%s' % uniq_suffix) - -HG_REMOTE_REPO = 'http://bitbucket.org/marcinkuzminski/vcs' +HG_REMOTE_REPO = os.path.join(TESTS_TMP_PATH, HG_REPO) TEST_HG_REPO = os.path.join(TESTS_TMP_PATH, HG_REPO) -TEST_HG_REPO_CLONE = os.path.join(TESTS_TMP_PATH, 'vcshgclone%s' % uniq_suffix) -TEST_HG_REPO_PULL = os.path.join(TESTS_TMP_PATH, 'vcshgpull%s' % uniq_suffix) +TEST_HG_REPO_CLONE = os.path.join(TESTS_TMP_PATH, 'vcs-hg-clone-%s' % uniq_suffix) +TEST_HG_REPO_PULL = os.path.join(TESTS_TMP_PATH, 'vcs-hg-pull-%s' % uniq_suffix) -# cached repos if any ! -# comment out to get some other repos from bb or github -GIT_REMOTE_REPO = os.path.join(TESTS_TMP_PATH, GIT_REPO) -HG_REMOTE_REPO = os.path.join(TESTS_TMP_PATH, HG_REPO) +# By default, some of the tests will utilise locally available +# repositories stored within tar.gz archives as source for +# cloning. Should you wish to use some other, remote archive, simply +# uncomment these entries and/or update the URLs to use. +# +# GIT_REMOTE_REPO = 'git://github.com/codeinn/vcs.git' +# HG_REMOTE_REPO = 'http://bitbucket.org/marcinkuzminski/vcs' # skip ldap tests if LDAP lib is not installed ldap_lib_installed = False diff --git a/kallithea/tests/vcs/__init__.py b/kallithea/tests/vcs/__init__.py --- a/kallithea/tests/vcs/__init__.py +++ b/kallithea/tests/vcs/__init__.py @@ -19,7 +19,7 @@ function at ``tests/__init__.py``. .. _unittest: http://pypi.python.org/pypi/unittest """ -from kallithea.tests.vcs.conf import * +from kallithea.tests.base import TEST_HG_REPO, HG_REMOTE_REPO, TEST_GIT_REPO, GIT_REMOTE_REPO from kallithea.tests.vcs.utils import SCMFetcher from kallithea.tests.base import * diff --git a/kallithea/tests/vcs/conf.py b/kallithea/tests/vcs/conf.py --- a/kallithea/tests/vcs/conf.py +++ b/kallithea/tests/vcs/conf.py @@ -2,38 +2,25 @@ Unit tests configuration module for vcs. """ import os -import tempfile import shutil import uuid +# Retrieve the necessary configuration options from the test base +# module. Some of these configuration options are subsequently +# consumed by the VCS test module. +from kallithea.tests.base import ( + TESTS_TMP_PATH, SCM_TESTS, + TEST_HG_REPO, HG_REMOTE_REPO, + TEST_GIT_REPO, GIT_REMOTE_REPO, +) + __all__ = ( 'TEST_HG_REPO', 'TEST_GIT_REPO', 'HG_REMOTE_REPO', 'GIT_REMOTE_REPO', 'SCM_TESTS', ) -SCM_TESTS = ['hg', 'git'] - THIS = os.path.abspath(os.path.dirname(__file__)) -GIT_REMOTE_REPO = 'git://github.com/codeinn/vcs.git' - -TESTS_TMP_PATH = os.environ.get('VCS_TEST_ROOT', tempfile.gettempdir()) - -TEST_GIT_REPO = os.environ.get('VCS_TEST_GIT_REPO', - os.path.join(TESTS_TMP_PATH, 'vcs-git')) -TEST_GIT_REPO_CLONE = os.environ.get('VCS_TEST_GIT_REPO_CLONE', - os.path.join(TESTS_TMP_PATH, 'vcs-git-clone')) -TEST_GIT_REPO_PULL = os.environ.get('VCS_TEST_GIT_REPO_PULL', - os.path.join(TESTS_TMP_PATH, 'vcs-git-pull')) - -HG_REMOTE_REPO = 'http://bitbucket.org/marcinkuzminski/vcs' -TEST_HG_REPO = os.environ.get('VCS_TEST_HG_REPO', - os.path.join(TESTS_TMP_PATH, 'vcs-hg')) -TEST_HG_REPO_CLONE = os.environ.get('VCS_TEST_HG_REPO_CLONE', - os.path.join(TESTS_TMP_PATH, 'vcs-hg-clone')) -TEST_HG_REPO_PULL = os.environ.get('VCS_TEST_HG_REPO_PULL', - os.path.join(TESTS_TMP_PATH, 'vcs-hg-pull')) - TEST_REPO_PREFIX = 'vcs-test'