changeset 1416:df04752daa64 beta

test env update
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 02 Jul 2011 20:38:54 +0200
parents 677408ee9355
children febb3f954509
files rhodecode/lib/hooks.py rhodecode/lib/utils.py rhodecode/tests/__init__.py rhodecode/tests/test_libs.py setup.cfg
diffstat 5 files changed, 15 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/hooks.py	Sat Jul 02 19:16:39 2011 +0200
+++ b/rhodecode/lib/hooks.py	Sat Jul 02 20:38:54 2011 +0200
@@ -24,7 +24,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 import os
 import sys
-import getpass
 
 from mercurial.scmutil import revrange
 from mercurial.node import nullrev
--- a/rhodecode/lib/utils.py	Sat Jul 02 19:16:39 2011 +0200
+++ b/rhodecode/lib/utils.py	Sat Jul 02 20:38:54 2011 +0200
@@ -494,27 +494,9 @@
         HG_FORK, GIT_FORK, TESTS_TMP_PATH
     import tarfile
     import shutil
-    from os.path import dirname as dn, join as jn, abspath
-
-    log = logging.getLogger('TestEnvCreator')
-    # create logger
-    log.setLevel(logging.DEBUG)
-    log.propagate = True
-    # create console handler and set level to debug
-    ch = logging.StreamHandler()
-    ch.setLevel(logging.DEBUG)
+    from os.path import abspath
 
-    # create formatter
-    formatter = logging.Formatter("%(asctime)s - %(name)s -"
-                                  " %(levelname)s - %(message)s")
-
-    # add formatter to ch
-    ch.setFormatter(formatter)
-
-    # add ch to logger
-    log.addHandler(ch)
-
-    #PART ONE create db
+    # PART ONE create db
     dbconf = config['sqlalchemy.db1.url']
     log.debug('making test db %s', dbconf)
 
@@ -532,16 +514,9 @@
     dbmanage.create_permissions()
     dbmanage.populate_default_permissions()
 
-    #PART TWO make test repo
+    # PART TWO make test repo
     log.debug('making test vcs repositories')
 
-    #remove old one from previos tests
-    for r in [HG_REPO, GIT_REPO, NEW_HG_REPO, NEW_GIT_REPO, HG_FORK, GIT_FORK]:
-
-        if os.path.isdir(jn(TESTS_TMP_PATH, r)):
-            log.debug('removing %s', r)
-            shutil.rmtree(jn(TESTS_TMP_PATH, r))
-
     idx_path = config['app_conf']['index_dir']
     data_path = config['app_conf']['cache_dir']
 
--- a/rhodecode/tests/__init__.py	Sat Jul 02 19:16:39 2011 +0200
+++ b/rhodecode/tests/__init__.py	Sat Jul 02 20:38:54 2011 +0200
@@ -27,19 +27,22 @@
 import pylons.test
 
 __all__ = ['environ', 'url', 'TestController', 'TESTS_TMP_PATH', 'HG_REPO',
-           'GIT_REPO', 'NEW_HG_REPO', 'NEW_GIT_REPO', 'HG_FORK', 'GIT_FORK', ]
+           'GIT_REPO', 'NEW_HG_REPO', 'NEW_GIT_REPO', 'HG_FORK', 'GIT_FORK',
+           'TEST_USER_ADMIN_LOGIN', 'TEST_USER_ADMIN_PASS' ]
 
 # Invoke websetup with the current config file
 #SetupCommand('setup-app').run([config_file])
 
 ##RUNNING DESIRED TESTS
-#nosetests -x rhodecode.tests.functional.test_admin_settings:TestSettingsController.test_my_account
-
+# nosetests -x rhodecode.tests.functional.test_admin_settings:TestSettingsController.test_my_account
+# nosetests --pdb --pdb-failures 
 environ = {}
 
 #SOME GLOBALS FOR TESTS
 from tempfile import _RandomNameSequence
 TESTS_TMP_PATH = jn('/', 'tmp', 'rc_test_%s' % _RandomNameSequence().next())
+TEST_USER_ADMIN_LOGIN = 'test_admin'
+TEST_USER_ADMIN_PASS = 'test12'
 HG_REPO = 'vcs_test_hg'
 GIT_REPO = 'vcs_test_git'
 
@@ -61,7 +64,8 @@
         self.index_location = config['app_conf']['index_dir']
         TestCase.__init__(self, *args, **kwargs)
 
-    def log_user(self, username='test_admin', password='test12'):
+    def log_user(self, username=TEST_USER_ADMIN_LOGIN,
+                 password=TEST_USER_ADMIN_PASS):
         response = self.app.post(url(controller='login', action='index'),
                                  {'username':username,
                                   'password':password})
--- a/rhodecode/tests/test_libs.py	Sat Jul 02 19:16:39 2011 +0200
+++ b/rhodecode/tests/test_libs.py	Sat Jul 02 20:38:54 2011 +0200
@@ -4,7 +4,7 @@
     ~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
-    Package for testing varios lib/helper functions in rhodecode
+    Package for testing various lib/helper functions in rhodecode
     
     :created_on: Jun 9, 2011
     :copyright: (c) 2011 by marcink.
@@ -16,7 +16,6 @@
 import unittest
 from rhodecode.tests import *
 
-
 proto = 'http'
 TEST_URLS = [
     ('%s://127.0.0.1' % proto, ['%s://' % proto, '127.0.0.1'],
--- a/setup.cfg	Sat Jul 02 19:16:39 2011 +0200
+++ b/setup.cfg	Sat Jul 02 20:38:54 2011 +0200
@@ -6,10 +6,11 @@
 find_links = http://www.pylonshq.com/download/
 
 [nosetests]
-verbose=True
+verbose=False
 verbosity=2
 with-pylons=test.ini
-detailed-errors=1
+detailed-errors=0
+nologcapture=1
 
 # Babel configuration
 [compile_catalog]