Show More
@@ -24,7 +24,6 b'' | |||
|
24 | 24 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
25 | 25 | import os |
|
26 | 26 | import sys |
|
27 | import getpass | |
|
28 | 27 | |
|
29 | 28 | from mercurial.scmutil import revrange |
|
30 | 29 | from mercurial.node import nullrev |
@@ -494,27 +494,9 b' def create_test_env(repos_test_path, con' | |||
|
494 | 494 | HG_FORK, GIT_FORK, TESTS_TMP_PATH |
|
495 | 495 | import tarfile |
|
496 | 496 | import shutil |
|
497 |
from os.path import |
|
|
498 | ||
|
499 | log = logging.getLogger('TestEnvCreator') | |
|
500 | # create logger | |
|
501 | log.setLevel(logging.DEBUG) | |
|
502 | log.propagate = True | |
|
503 | # create console handler and set level to debug | |
|
504 | ch = logging.StreamHandler() | |
|
505 | ch.setLevel(logging.DEBUG) | |
|
497 | from os.path import abspath | |
|
506 | 498 | |
|
507 | # create formatter | |
|
508 | formatter = logging.Formatter("%(asctime)s - %(name)s -" | |
|
509 | " %(levelname)s - %(message)s") | |
|
510 | ||
|
511 | # add formatter to ch | |
|
512 | ch.setFormatter(formatter) | |
|
513 | ||
|
514 | # add ch to logger | |
|
515 | log.addHandler(ch) | |
|
516 | ||
|
517 | #PART ONE create db | |
|
499 | # PART ONE create db | |
|
518 | 500 | dbconf = config['sqlalchemy.db1.url'] |
|
519 | 501 | log.debug('making test db %s', dbconf) |
|
520 | 502 | |
@@ -532,16 +514,9 b' def create_test_env(repos_test_path, con' | |||
|
532 | 514 | dbmanage.create_permissions() |
|
533 | 515 | dbmanage.populate_default_permissions() |
|
534 | 516 | |
|
535 | #PART TWO make test repo | |
|
517 | # PART TWO make test repo | |
|
536 | 518 | log.debug('making test vcs repositories') |
|
537 | 519 | |
|
538 | #remove old one from previos tests | |
|
539 | for r in [HG_REPO, GIT_REPO, NEW_HG_REPO, NEW_GIT_REPO, HG_FORK, GIT_FORK]: | |
|
540 | ||
|
541 | if os.path.isdir(jn(TESTS_TMP_PATH, r)): | |
|
542 | log.debug('removing %s', r) | |
|
543 | shutil.rmtree(jn(TESTS_TMP_PATH, r)) | |
|
544 | ||
|
545 | 520 | idx_path = config['app_conf']['index_dir'] |
|
546 | 521 | data_path = config['app_conf']['cache_dir'] |
|
547 | 522 |
@@ -27,19 +27,22 b' log = logging.getLogger(__name__)' | |||
|
27 | 27 | import pylons.test |
|
28 | 28 | |
|
29 | 29 | __all__ = ['environ', 'url', 'TestController', 'TESTS_TMP_PATH', 'HG_REPO', |
|
30 |
'GIT_REPO', 'NEW_HG_REPO', 'NEW_GIT_REPO', 'HG_FORK', 'GIT_FORK', |
|
|
30 | 'GIT_REPO', 'NEW_HG_REPO', 'NEW_GIT_REPO', 'HG_FORK', 'GIT_FORK', | |
|
31 | 'TEST_USER_ADMIN_LOGIN', 'TEST_USER_ADMIN_PASS' ] | |
|
31 | 32 | |
|
32 | 33 | # Invoke websetup with the current config file |
|
33 | 34 | #SetupCommand('setup-app').run([config_file]) |
|
34 | 35 | |
|
35 | 36 | ##RUNNING DESIRED TESTS |
|
36 | #nosetests -x rhodecode.tests.functional.test_admin_settings:TestSettingsController.test_my_account | |
|
37 | ||
|
37 | # nosetests -x rhodecode.tests.functional.test_admin_settings:TestSettingsController.test_my_account | |
|
38 | # nosetests --pdb --pdb-failures | |
|
38 | 39 | environ = {} |
|
39 | 40 | |
|
40 | 41 | #SOME GLOBALS FOR TESTS |
|
41 | 42 | from tempfile import _RandomNameSequence |
|
42 | 43 | TESTS_TMP_PATH = jn('/', 'tmp', 'rc_test_%s' % _RandomNameSequence().next()) |
|
44 | TEST_USER_ADMIN_LOGIN = 'test_admin' | |
|
45 | TEST_USER_ADMIN_PASS = 'test12' | |
|
43 | 46 | HG_REPO = 'vcs_test_hg' |
|
44 | 47 | GIT_REPO = 'vcs_test_git' |
|
45 | 48 | |
@@ -61,7 +64,8 b' class TestController(TestCase):' | |||
|
61 | 64 | self.index_location = config['app_conf']['index_dir'] |
|
62 | 65 | TestCase.__init__(self, *args, **kwargs) |
|
63 | 66 | |
|
64 | def log_user(self, username='test_admin', password='test12'): | |
|
67 | def log_user(self, username=TEST_USER_ADMIN_LOGIN, | |
|
68 | password=TEST_USER_ADMIN_PASS): | |
|
65 | 69 | response = self.app.post(url(controller='login', action='index'), |
|
66 | 70 | {'username':username, |
|
67 | 71 | 'password':password}) |
@@ -4,7 +4,7 b'' | |||
|
4 | 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
5 | 5 | |
|
6 | 6 | |
|
7 | Package for testing varios lib/helper functions in rhodecode | |
|
7 | Package for testing various lib/helper functions in rhodecode | |
|
8 | 8 | |
|
9 | 9 | :created_on: Jun 9, 2011 |
|
10 | 10 | :copyright: (c) 2011 by marcink. |
@@ -16,7 +16,6 b'' | |||
|
16 | 16 | import unittest |
|
17 | 17 | from rhodecode.tests import * |
|
18 | 18 | |
|
19 | ||
|
20 | 19 | proto = 'http' |
|
21 | 20 | TEST_URLS = [ |
|
22 | 21 | ('%s://127.0.0.1' % proto, ['%s://' % proto, '127.0.0.1'], |
@@ -6,10 +6,11 b' tag_svn_revision = true' | |||
|
6 | 6 | find_links = http://www.pylonshq.com/download/ |
|
7 | 7 | |
|
8 | 8 | [nosetests] |
|
9 |
verbose= |
|
|
9 | verbose=False | |
|
10 | 10 | verbosity=2 |
|
11 | 11 | with-pylons=test.ini |
|
12 |
detailed-errors= |
|
|
12 | detailed-errors=0 | |
|
13 | nologcapture=1 | |
|
13 | 14 | |
|
14 | 15 | # Babel configuration |
|
15 | 16 | [compile_catalog] |
General Comments 0
You need to be logged in to leave comments.
Login now