Changeset - df04752daa64
[Not reviewed]
beta
0 5 0
Marcin Kuzminski - 14 years ago 2011-07-02 20:38:54
marcin@python-works.com
test env update
5 files changed with 12 insertions and 34 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/hooks.py
Show inline comments
 
@@ -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
rhodecode/lib/utils.py
Show inline comments
 
@@ -494,25 +494,7 @@ def create_test_env(repos_test_path, con
 
        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)
 

	
 
    # 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)
 
    from os.path import abspath
 

	
 
    #PART ONE create db
 
    dbconf = config['sqlalchemy.db1.url']
 
@@ -535,13 +517,6 @@ def create_test_env(repos_test_path, con
 
    #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']
 

	
rhodecode/tests/__init__.py
Show inline comments
 
@@ -27,19 +27,22 @@ log = logging.getLogger(__name__)
 
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 --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 @@ class TestController(TestCase):
 
        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})
rhodecode/tests/test_libs.py
Show inline comments
 
@@ -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'],
setup.cfg
Show inline comments
 
@@ -6,10 +6,11 @@ tag_svn_revision = true
 
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]
0 comments (0 inline, 0 general)