changeset 6656:f0705609e494

tests: drop 'environ' as global variable - just pass it to URLGenerator as temporary variable HTTP_HOST is mandatory - specify it as 'example.com'.
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 28 May 2017 19:42:23 +0200
parents 6452215a54ee
children 5ef3c8c1c2c1
files kallithea/tests/base.py kallithea/tests/conftest.py
diffstat 2 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/tests/base.py	Wed Mar 29 22:12:50 2017 +0200
+++ b/kallithea/tests/base.py	Sun May 28 19:42:23 2017 +0200
@@ -39,7 +39,7 @@
 testapp = None
 
 __all__ = [
-    'skipif', 'parametrize', 'environ', 'url', 'TestController',
+    'skipif', 'parametrize', 'url', 'TestController',
     'ldap_lib_installed', 'pam_lib_installed', 'invalidate_all_caches',
     'TESTS_TMP_PATH', 'HG_REPO', 'GIT_REPO', 'NEW_HG_REPO', 'NEW_GIT_REPO',
     'HG_FORK', 'GIT_FORK', 'TEST_USER_ADMIN_LOGIN', 'TEST_USER_ADMIN_PASS',
@@ -54,8 +54,6 @@
 # Invoke websetup with the current config file
 # SetupCommand('setup-app').run([config_file])
 
-environ = {}
-
 #SOME GLOBALS FOR TESTS
 
 TESTS_TMP_PATH = os.path.join(tempfile.gettempdir(), 'rc_test_%s' % tempfile._RandomNameSequence().next())
--- a/kallithea/tests/conftest.py	Wed Mar 29 22:12:50 2017 +0200
+++ b/kallithea/tests/conftest.py	Sun May 28 19:42:23 2017 +0200
@@ -55,7 +55,7 @@
 
     logging.disable(logging.NOTSET)
 
-    kallithea.tests.base.url = URLGenerator(RootController().mapper, kallithea.tests.base.environ)
+    kallithea.tests.base.url = URLGenerator(RootController().mapper, {'HTTP_HOST': 'example.com'})
 
 
 @pytest.fixture