##// END OF EJS Templates
Improved testing scenarios. Made test env creator...
marcink -
r473:6b934c96 celery
parent child Browse files
Show More
@@ -49,7 +49,10 b' def load_environment(global_conf, app_co'
49
49
50 #sets the c attribute access when don't existing attribute are accessed
50 #sets the c attribute access when don't existing attribute are accessed
51 config['pylons.strict_tmpl_context'] = True
51 config['pylons.strict_tmpl_context'] = True
52 test = os.path.split(config['__file__'])[-1] == 'tests.ini'
52 test = os.path.split(config['__file__'])[-1] == 'test.ini'
53 if test:
54 from pylons_app.lib.utils import make_test_env
55 make_test_env()
53 #MULTIPLE DB configs
56 #MULTIPLE DB configs
54 # Setup the SQLAlchemy database engine
57 # Setup the SQLAlchemy database engine
55 if config['debug'] and not test:
58 if config['debug'] and not test:
@@ -106,7 +106,7 b' class SettingsController(BaseController)'
106 if setting_id == 'whoosh':
106 if setting_id == 'whoosh':
107 repo_location = get_hg_ui_settings()['paths_root_path']
107 repo_location = get_hg_ui_settings()['paths_root_path']
108 full_index = request.POST.get('full_index',False)
108 full_index = request.POST.get('full_index',False)
109 task = run_task(tasks.whoosh_index,True,repo_location,full_index)
109 task = run_task(tasks.whoosh_index,repo_location,full_index)
110
110
111 h.flash(_('Whoosh reindex task scheduled'), category='success')
111 h.flash(_('Whoosh reindex task scheduled'), category='success')
112 if setting_id == 'global':
112 if setting_id == 'global':
@@ -61,7 +61,7 b' class SummaryController(BaseController):'
61 for name, hash in c.repo_info.branches.items()[:10]:
61 for name, hash in c.repo_info.branches.items()[:10]:
62 c.repo_branches[name] = c.repo_info.get_changeset(hash)
62 c.repo_branches[name] = c.repo_info.get_changeset(hash)
63
63
64 task = run_task(get_commits_stats,False,c.repo_info.name)
64 task = run_task(get_commits_stats,c.repo_info.name)
65 c.ts_min = task.result[0]
65 c.ts_min = task.result[0]
66 c.ts_max = task.result[1]
66 c.ts_max = task.result[1]
67 c.commit_data = task.result[2]
67 c.commit_data = task.result[2]
@@ -16,6 +16,7 b''
16 # along with this program; if not, write to the Free Software
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 # MA 02110-1301, USA.
18 # MA 02110-1301, USA.
19 import shutil
19
20
20 """
21 """
21 Created on April 18, 2010
22 Created on April 18, 2010
@@ -31,6 +32,8 b' from vcs.backends.base import BaseChange'
31 from vcs.utils.lazy import LazyProperty
32 from vcs.utils.lazy import LazyProperty
32 import logging
33 import logging
33 import os
34 import os
35 from os.path import dirname as dn, join as jn
36 import tarfile
34 log = logging.getLogger(__name__)
37 log = logging.getLogger(__name__)
35
38
36
39
@@ -362,3 +365,68 b' class OrderedDict(dict, DictMixin):'
362
365
363 def __ne__(self, other):
366 def __ne__(self, other):
364 return not self == other
367 return not self == other
368
369 def make_test_env():
370 """Makes a fresh database from base64+zlib dump and
371 install test repository into tmp dir
372 """
373 new_db_dump = """
374 eJztXN1vE8sVn9nxR+wAIXDpFiiXjSAXfEOc2ElwQkVLPjYf5NNOAklUydrYG3tv1t5ldx0nuUJV\noL
375 cPrVr1X7jSfUJ96nMfK1Xty23VqlWlPlRIlahUXbXqFUL0pTNjx5614xAoKEDmJ3t2zpkzM2fO\neHe+
376 zno+PqU5qrRmWDnFkXqAB0AIbkkSAKANf8+BKprwFzI0G28ECXQ+PufFEYT+Tehz6L/oaSnK\nwcFxGP
377 igFQfHjuMg4CehH7UA9Af0Y2ShWdSPLmOSg+N9x7U9eKf9PiC2nIWm4mTtri4nZ3Z9DE/5\nfOD0+RZY
378 VFdXFVstWHoXPOPFvDbKU3TdKCbNgp39GLZ5MPtKW5WtWKmstqFmtqVtzZRWt6NQRFjk\ngkhESJ6kbe
379 trim6rcFTAdcfuwqxhrNuprJLPqBnLKJhhSzWNpK1tq+aWkzXyN8wt3cjbScU0w7q2\nGqbyVSHYAXE5
380 kSv15RTMtOKo2YxUikjf+SgKg4Dc/38C6Dn6Gn2FnqDH6K+Y5ODgeGfhRRD6/ST0\n+Ujo9ZLQ4yE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Q8R+i3wP84eDgeNfRCX3gAoRjGyk7Sc
407 78BUDPZdlJ\n0ZphSbvJZPyH6D8Afzg4ON5/HEMX4O7tD0v3/3OAPxwcHEcG1f0/hJ4A9Az9C184ODje
408 Q/gQ+WcP\nKPgEevX5IL0GyPiP0Fdl/7/D1pKDg+PNYe/3f+j4/wSP/88OWz8ODo43Ab+H3O0CKl19Qu
409 kaoPN/\nD/gcgM+FD4W7ws8OW886PNg+UTp4jlX8aJOOQR0a2XhrnVftbkrFubZM7+dkewA/zgYS9a6x
410 1erq\nXWRr0thDZLdfJ3uU7PI+rXcMfYWT6Bq33WtSrVNprGW/Y2VXUyIsdSp28sAZoyx1+kGulXqTfx
411 aq\ndrduZOxK5Ex9RxN2pZcx8So9XEozKw4D1Vdn6v0RFLdfeolM0r/U2d9buqRbvekZ/iv0IpulqrYr
412 \nl9sRo+rBEAyR+x8/ADg4OI4gyPyf3/8cHEcTJf+fpwB/ODg4jgSaoBfQ/QB+/s/BcSRR3f+H6Bng\n
413 e/8cHEcHpf1/CI+jHwEP3AToLtx8e9/9e//w8Hun6bHGDz+tvE+3uwfOxsW69+nYYw2WfjPHGtX9\n5A
414 MdfNQo9P+eS7youNdyVuJq4ot2zRsdnLgLCYYip/b7w5jKqUX51IREv4F/FJ7YBy96ja963sJS\n34yd
415 OXDGKEud/R8efZUt\n
416 """
417 newdb = open('test.db','wb')
418 newdb.write(new_db_dump.decode('base64').decode('zlib'))
419 newdb.close()
420
421
422 #PART TWO make test repo
423 if os.path.isdir('/tmp/vcs_test'):
424 shutil.rmtree('/tmp/vcs_test')
425
426 cur_dir = dn(dn(os.path.abspath(__file__)))
427 tar = tarfile.open(jn(cur_dir,'tests',"vcs_test.tar.gz"))
428 tar.extractall('/tmp')
429 tar.close()
430
431
432 No newline at end of file
@@ -1,15 +1,8 b''
1 """The application's model objects"""
1 """The application's model objects"""
2 import logging
2 import logging
3 import sqlalchemy as sa
4 from sqlalchemy import orm
5 from pylons_app.model import meta
3 from pylons_app.model import meta
6 from pylons_app.model.meta import Session
7 log = logging.getLogger(__name__)
4 log = logging.getLogger(__name__)
8
5
9 # Add these two imports:
10 import datetime
11 from sqlalchemy import schema, types
12
13 def init_model(engine):
6 def init_model(engine):
14 """Call me before using any of the tables or classes in the model"""
7 """Call me before using any of the tables or classes in the model"""
15 log.info("INITIALIZING DB MODELS")
8 log.info("INITIALIZING DB MODELS")
@@ -26,7 +26,7 b' class HgAppUi(Base):'
26
26
27 class User(Base):
27 class User(Base):
28 __tablename__ = 'users'
28 __tablename__ = 'users'
29 __table_args__ = (UniqueConstraint('username'), {'useexisting':True})
29 __table_args__ = (UniqueConstraint('username'), UniqueConstraint('email'), {'useexisting':True})
30 user_id = Column("user_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True)
30 user_id = Column("user_id", INTEGER(), nullable=False, unique=True, default=None, primary_key=True)
31 username = Column("username", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
31 username = Column("username", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
32 password = Column("password", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
32 password = Column("password", TEXT(length=None, convert_unicode=False, assert_unicode=None), nullable=True, unique=None, default=None)
@@ -56,7 +56,7 b' class User(Base):'
56 self.last_login = datetime.datetime.now()
56 self.last_login = datetime.datetime.now()
57 session.add(self)
57 session.add(self)
58 session.commit()
58 session.commit()
59 log.debug('updated user %s lastlogin',self.username)
59 log.debug('updated user %s lastlogin', self.username)
60 except Exception:
60 except Exception:
61 session.rollback()
61 session.rollback()
62
62
@@ -102,7 +102,7 b' class HgModel(object):'
102 if repos_path[0] != '/':
102 if repos_path[0] != '/':
103 repos_path[0] = '/'
103 repos_path[0] = '/'
104 if not os.path.isdir(os.path.join(*repos_path)):
104 if not os.path.isdir(os.path.join(*repos_path)):
105 raise RepositoryError('Not a valid repository in %s' % path[0][1])
105 raise RepositoryError('Not a valid repository in %s' % path)
106 if not repos_path.endswith('*'):
106 if not repos_path.endswith('*'):
107 raise VCSError('You need to specify * or ** at the end of path '
107 raise VCSError('You need to specify * or ** at the end of path '
108 'for recursive scanning')
108 'for recursive scanning')
@@ -16,12 +16,15 b' from routes.util import URLGenerator'
16 from webtest import TestApp
16 from webtest import TestApp
17 import os
17 import os
18 from pylons_app.model import meta
18 from pylons_app.model import meta
19 import logging
20 log = logging.getLogger(__name__)
21
19 import pylons.test
22 import pylons.test
20
23
21 __all__ = ['environ', 'url', 'TestController']
24 __all__ = ['environ', 'url', 'TestController']
22
25
23 # Invoke websetup with the current config file
26 # Invoke websetup with the current config file
24 SetupCommand('setup-app').run([pylons.test.pylonsapp.config['__file__']])
27 #SetupCommand('setup-app').run([pylons.test.pylonsapp.config['__file__']])
25
28
26 environ = {}
29 environ = {}
27
30
@@ -42,4 +45,5 b' class TestController(TestCase):'
42 'password':'test'})
45 'password':'test'})
43 assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status
46 assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status
44 assert response.session['hg_app_user'].username == 'test_admin', 'wrong logged in user'
47 assert response.session['hg_app_user'].username == 'test_admin', 'wrong logged in user'
45 return response.follow() No newline at end of file
48 return response.follow()
49 No newline at end of file
@@ -3,5 +3,7 b' from pylons_app.tests import *'
3 class TestAdminController(TestController):
3 class TestAdminController(TestController):
4
4
5 def test_index(self):
5 def test_index(self):
6 self.log_user()
6 response = self.app.get(url(controller='admin/admin', action='index'))
7 response = self.app.get(url(controller='admin/admin', action='index'))
8 assert 'Admin dashboard - journal' in response.body,'No proper title in dashboard'
7 # Test response...
9 # Test response...
@@ -3,5 +3,6 b' from pylons_app.tests import *'
3 class TestBranchesController(TestController):
3 class TestBranchesController(TestController):
4
4
5 def test_index(self):
5 def test_index(self):
6 self.log_user()
6 response = self.app.get(url(controller='branches', action='index',repo_name='vcs_test'))
7 response = self.app.get(url(controller='branches', action='index',repo_name='vcs_test'))
7 # Test response...
8 # Test response...
@@ -3,5 +3,6 b' from pylons_app.tests import *'
3 class TestChangelogController(TestController):
3 class TestChangelogController(TestController):
4
4
5 def test_index(self):
5 def test_index(self):
6 self.log_user()
6 response = self.app.get(url(controller='changelog', action='index',repo_name='vcs_test'))
7 response = self.app.get(url(controller='changelog', action='index',repo_name='vcs_test'))
7 # Test response...
8 # Test response...
@@ -3,11 +3,13 b' from pylons_app.tests import *'
3 class TestFeedController(TestController):
3 class TestFeedController(TestController):
4
4
5 def test_rss(self):
5 def test_rss(self):
6 self.log_user()
6 response = self.app.get(url(controller='feed', action='rss',
7 response = self.app.get(url(controller='feed', action='rss',
7 repo_name='vcs_test'))
8 repo_name='vcs_test'))
8 # Test response...
9 # Test response...
9
10
10 def test_atom(self):
11 def test_atom(self):
12 self.log_user()
11 response = self.app.get(url(controller='feed', action='atom',
13 response = self.app.get(url(controller='feed', action='atom',
12 repo_name='vcs_test'))
14 repo_name='vcs_test'))
13 # Test response... No newline at end of file
15 # Test response...
@@ -3,6 +3,7 b' from pylons_app.tests import *'
3 class TestFilesController(TestController):
3 class TestFilesController(TestController):
4
4
5 def test_index(self):
5 def test_index(self):
6 self.log_user()
6 response = self.app.get(url(controller='files', action='index',
7 response = self.app.get(url(controller='files', action='index',
7 repo_name='vcs_test',
8 repo_name='vcs_test',
8 revision='tip',
9 revision='tip',
@@ -82,9 +82,9 b' class TestLoginController(TestController'
82
82
83
83
84 def test_register_ok(self):
84 def test_register_ok(self):
85 username = 'test_regular2'
85 username = 'test_regular4'
86 password = 'qweqwe'
86 password = 'qweqwe'
87 email = 'goodmail@mail.com'
87 email = 'marcin@somemail.com'
88 name = 'testname'
88 name = 'testname'
89 lastname = 'testlastname'
89 lastname = 'testlastname'
90
90
@@ -94,10 +94,11 b' class TestLoginController(TestController'
94 'email':email,
94 'email':email,
95 'name':name,
95 'name':name,
96 'lastname':lastname})
96 'lastname':lastname})
97
97 print response.body
98 assert response.status == '302 Found', 'Wrong response from register page got %s' % response.status
98 assert response.status == '302 Found', 'Wrong response from register page got %s' % response.status
99 assert 'You have successfully registered into hg-app' in response.session['flash'][0], 'No flash message about user registration'
99
100
100 ret = self.sa.query(User).filter(User.username == 'test_regular2').one()
101 ret = self.sa.query(User).filter(User.username == 'test_regular4').one()
101 assert ret.username == username , 'field mismatch %s %s' % (ret.username, username)
102 assert ret.username == username , 'field mismatch %s %s' % (ret.username, username)
102 assert check_password(password,ret.password) == True , 'password mismatch'
103 assert check_password(password,ret.password) == True , 'password mismatch'
103 assert ret.email == email , 'field mismatch %s %s' % (ret.email, email)
104 assert ret.email == email , 'field mismatch %s %s' % (ret.email, email)
@@ -105,7 +106,34 b' class TestLoginController(TestController'
105 assert ret.lastname == lastname , 'field mismatch %s %s' % (ret.lastname, lastname)
106 assert ret.lastname == lastname , 'field mismatch %s %s' % (ret.lastname, lastname)
106
107
107
108
109 def test_forgot_password_wrong_mail(self):
110 response = self.app.post(url(controller='login', action='password_reset'),
111 {'email':'marcin@wrongmail.org',})
112
113 assert "That e-mail address doesn't exist" in response.body,'Missing error message about wrong email'
114
115 def test_forgot_password(self):
116 response = self.app.get(url(controller='login', action='password_reset'))
117 assert response.status == '200 OK', 'Wrong response from login page got %s' % response.status
118
119 username = 'test_password_reset_1'
120 password = 'qweqwe'
121 email = 'marcin@python-works.com'
122 name = 'passwd'
123 lastname = 'reset'
124
125 response = self.app.post(url(controller='login', action='register'),
126 {'username':username,
127 'password':password,
128 'email':email,
129 'name':name,
130 'lastname':lastname})
131 #register new user for email test
132 response = self.app.post(url(controller='login', action='password_reset'),
133 {'email':email,})
134 print response.session['flash']
135 assert 'You have successfully registered into hg-app' in response.session['flash'][0], 'No flash message about user registration'
136 assert 'Your new password was sent' in response.session['flash'][1], 'No flash message about password reset'
108
137
109
138
110
139
111
@@ -3,6 +3,7 b' from pylons_app.tests import *'
3 class TestSettingsController(TestController):
3 class TestSettingsController(TestController):
4
4
5 def test_index(self):
5 def test_index(self):
6 self.log_user()
6 response = self.app.get(url(controller='settings', action='index',
7 response = self.app.get(url(controller='settings', action='index',
7 repo_name='vcs_test'))
8 repo_name='vcs_test'))
8 # Test response...
9 # Test response...
@@ -3,5 +3,6 b' from pylons_app.tests import *'
3 class TestShortlogController(TestController):
3 class TestShortlogController(TestController):
4
4
5 def test_index(self):
5 def test_index(self):
6 self.log_user()
6 response = self.app.get(url(controller='shortlog', action='index',repo_name='vcs_test'))
7 response = self.app.get(url(controller='shortlog', action='index',repo_name='vcs_test'))
7 # Test response...
8 # Test response...
@@ -3,5 +3,6 b' from pylons_app.tests import *'
3 class TestSummaryController(TestController):
3 class TestSummaryController(TestController):
4
4
5 def test_index(self):
5 def test_index(self):
6 self.log_user()
6 response = self.app.get(url(controller='summary', action='index',repo_name='vcs_test'))
7 response = self.app.get(url(controller='summary', action='index',repo_name='vcs_test'))
7 # Test response...
8 # Test response...
@@ -3,5 +3,6 b' from pylons_app.tests import *'
3 class TestTagsController(TestController):
3 class TestTagsController(TestController):
4
4
5 def test_index(self):
5 def test_index(self):
6 self.log_user()
6 response = self.app.get(url(controller='tags', action='index',repo_name='vcs_test'))
7 response = self.app.get(url(controller='tags', action='index',repo_name='vcs_test'))
7 # Test response...
8 # Test response...
@@ -1,40 +1,38 b''
1 """Setup the pylons_app application"""
1 """Setup the pylons_app application"""
2
2
3 from os.path import dirname as dn, join as jn
3 from os.path import dirname as dn
4 from pylons_app.config.environment import load_environment
4 from pylons_app.config.environment import load_environment
5 from pylons_app.lib.db_manage import DbManage
5 from pylons_app.lib.db_manage import DbManage
6 import datetime
7 from time import mktime
8 import logging
6 import logging
9 import os
7 import os
10 import sys
8 import sys
11 import tarfile
12
9
13 log = logging.getLogger(__name__)
10 log = logging.getLogger(__name__)
14
11
15 ROOT = dn(dn(os.path.realpath(__file__)))
12 ROOT = dn(dn(os.path.realpath(__file__)))
16 sys.path.append(ROOT)
13 sys.path.append(ROOT)
17
14
15
18 def setup_app(command, conf, vars):
16 def setup_app(command, conf, vars):
19 """Place any commands to setup pylons_app here"""
17 """Place any commands to setup pylons_app here"""
20 log_sql = True
18 log_sql = True
21 tests = False
19 tests = False
20 REPO_TEST_PATH = None
22
21
23 dbname = os.path.split(conf['sqlalchemy.db1.url'])[-1]
22 dbname = os.path.split(conf['sqlalchemy.db1.url'])[-1]
24 filename = os.path.split(conf.filename)[-1]
23 # filename = os.path.split(conf.filename)[-1]
25
24 # if filename == 'test.ini':
26 if filename == 'tests.ini':
25 # uniq_suffix = str(int(mktime(datetime.datetime.now().timetuple())))
27 uniq_suffix = str(int(mktime(datetime.datetime.now().timetuple())))
26 # REPO_TEST_PATH = '/tmp/hg_app_test_%s' % uniq_suffix
28 REPO_TEST_PATH = '/tmp/hg_app_test_%s' % uniq_suffix
27 #
29
28 # if not os.path.isdir(REPO_TEST_PATH):
30 if not os.path.isdir(REPO_TEST_PATH):
29 # os.mkdir(REPO_TEST_PATH)
31 os.mkdir(REPO_TEST_PATH)
30 # cur_dir = dn(os.path.abspath(__file__))
32 cur_dir = dn(os.path.abspath(__file__))
31 # tar = tarfile.open(jn(cur_dir,'tests',"vcs_test.tar.gz"))
33 tar = tarfile.open(jn(cur_dir,'tests',"vcs_test.tar.gz"))
32 # tar.extractall(REPO_TEST_PATH)
34 tar.extractall(REPO_TEST_PATH)
33 # tar.close()
35 tar.close()
34 #
36
35 # tests = True
37 tests = True
38
36
39 dbmanage = DbManage(log_sql, dbname, tests)
37 dbmanage = DbManage(log_sql, dbname, tests)
40 dbmanage.create_tables(override=True)
38 dbmanage.create_tables(override=True)
@@ -8,7 +8,7 b' find_links = http://www.pylonshq.com/dow'
8 [nosetests]
8 [nosetests]
9 verbose=True
9 verbose=True
10 verbosity=2
10 verbosity=2
11 with-pylons=tests.ini
11 with-pylons=test.ini
12 detailed-errors=1
12 detailed-errors=1
13
13
14 # Babel configuration
14 # Babel configuration
1 NO CONTENT: file renamed from tests.ini to test.ini
NO CONTENT: file renamed from tests.ini to test.ini
General Comments 0
You need to be logged in to leave comments. Login now