Show More
@@ -24,7 +24,7 b' versioning implementation: http://semver' | |||||
24 | @author: marcink |
|
24 | @author: marcink | |
25 | """ |
|
25 | """ | |
26 |
|
26 | |||
27 |
VERSION = (1, 0, 0, |
|
27 | VERSION = (1, 0, 0,) | |
28 |
|
28 | |||
29 | __version__ = '.'.join((str(each) for each in VERSION[:4])) |
|
29 | __version__ = '.'.join((str(each) for each in VERSION[:4])) | |
30 |
|
30 |
@@ -460,6 +460,7 b' def create_test_env(repos_test_path, con' | |||||
460 | import tarfile |
|
460 | import tarfile | |
461 | import shutil |
|
461 | import shutil | |
462 | from os.path import dirname as dn, join as jn, abspath |
|
462 | from os.path import dirname as dn, join as jn, abspath | |
|
463 | from rhodecode.tests import REPO_PATH, NEW_REPO_PATH | |||
463 |
|
464 | |||
464 | log = logging.getLogger('TestEnvCreator') |
|
465 | log = logging.getLogger('TestEnvCreator') | |
465 | # create logger |
|
466 | # create logger | |
@@ -493,8 +494,12 b' def create_test_env(repos_test_path, con' | |||||
493 |
|
494 | |||
494 | #PART TWO make test repo |
|
495 | #PART TWO make test repo | |
495 | log.debug('making test vcs repo') |
|
496 | log.debug('making test vcs repo') | |
496 |
if os.path.isdir( |
|
497 | if os.path.isdir(REPO_PATH): | |
497 | shutil.rmtree('/tmp/vcs_test') |
|
498 | log.debug('REMOVING %s', REPO_PATH) | |
|
499 | shutil.rmtree(REPO_PATH) | |||
|
500 | if os.path.isdir(NEW_REPO_PATH): | |||
|
501 | log.debug('REMOVING %s', NEW_REPO_PATH) | |||
|
502 | shutil.rmtree(NEW_REPO_PATH) | |||
498 |
|
503 | |||
499 | cur_dir = dn(dn(abspath(__file__))) |
|
504 | cur_dir = dn(dn(abspath(__file__))) | |
500 | tar = tarfile.open(jn(cur_dir, 'tests', "vcs_test.tar.gz")) |
|
505 | tar = tarfile.open(jn(cur_dir, 'tests', "vcs_test.tar.gz")) |
@@ -25,7 +25,7 b'' | |||||
25 | %endif |
|
25 | %endif | |
26 | %endfor |
|
26 | %endfor | |
27 | %if c.cur_query and c.formated_results: |
|
27 | %if c.cur_query and c.formated_results: | |
28 | <div class="pagination-wh pagination-left"> |
|
28 | <div class="pagination-wh pagination-left" style="padding-left:16px"> | |
29 | ${c.formated_results.pager('$link_previous ~2~ $link_next')} |
|
29 | ${c.formated_results.pager('$link_previous ~2~ $link_next')} | |
30 | </div> |
|
30 | </div> | |
31 | %endif No newline at end of file |
|
31 | %endif |
@@ -18,8 +18,7 b' import os' | |||||
18 | from rhodecode.model import meta |
|
18 | from rhodecode.model import meta | |
19 | import logging |
|
19 | import logging | |
20 |
|
20 | |||
21 |
|
21 | log = logging.getLogger(__name__) | ||
22 | log = logging.getLogger(__name__) |
|
|||
23 |
|
22 | |||
24 | import pylons.test |
|
23 | import pylons.test | |
25 |
|
24 | |||
@@ -32,6 +31,9 b' import pylons.test' | |||||
32 | #nosetests rhodecode.tests.functional.test_admin_settings:TestSettingsController.test_my_account |
|
31 | #nosetests rhodecode.tests.functional.test_admin_settings:TestSettingsController.test_my_account | |
33 |
|
32 | |||
34 | environ = {} |
|
33 | environ = {} | |
|
34 | TEST_DIR = '/tmp' | |||
|
35 | REPO_PATH = os.path.join(TEST_DIR, 'vcs_test') | |||
|
36 | NEW_REPO_PATH = os.path.join(TEST_DIR, 'vcs_test_new') | |||
35 |
|
37 | |||
36 | class TestController(TestCase): |
|
38 | class TestController(TestCase): | |
37 |
|
39 | |||
@@ -43,16 +45,16 b' class TestController(TestCase):' | |||||
43 | self.sa = meta.Session |
|
45 | self.sa = meta.Session | |
44 |
|
46 | |||
45 | TestCase.__init__(self, *args, **kwargs) |
|
47 | TestCase.__init__(self, *args, **kwargs) | |
46 |
|
48 | |||
47 | def log_user(self, username='test_admin', password='test12'): |
|
49 | def log_user(self, username='test_admin', password='test12'): | |
48 | response = self.app.post(url(controller='login', action='index'), |
|
50 | response = self.app.post(url(controller='login', action='index'), | |
49 | {'username':username, |
|
51 | {'username':username, | |
50 | 'password':password}) |
|
52 | 'password':password}) | |
51 | print response |
|
53 | print response | |
52 |
|
54 | |||
53 | if 'invalid user name' in response.body: |
|
55 | if 'invalid user name' in response.body: | |
54 | assert False, 'could not login using %s %s' % (username, password) |
|
56 | assert False, 'could not login using %s %s' % (username, password) | |
55 |
|
57 | |||
56 | assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status |
|
58 | assert response.status == '302 Found', 'Wrong response code from login got %s' % response.status | |
57 | assert response.session['rhodecode_user'].username == username, 'wrong logged in user got %s expected %s' % (response.session['rhodecode_user'].username, username) |
|
59 | assert response.session['rhodecode_user'].username == username, 'wrong logged in user got %s expected %s' % (response.session['rhodecode_user'].username, username) | |
58 | return response.follow() |
|
60 | return response.follow() |
@@ -5,16 +5,15 b' class TestChangelogController(TestContro' | |||||
5 | def test_index(self): |
|
5 | def test_index(self): | |
6 | self.log_user() |
|
6 | self.log_user() | |
7 | 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')) | |
8 |
|
8 | |||
9 | print response |
|
9 | assert """<div id="chg_20" class="container">""" in response.body, 'wrong info about number of changes' | |
10 | assert """<div id="chg_20" class="container">""" in response.body, 'wrong info about number ofchanges' |
|
|||
11 | assert """Small update at simplevcs app""" in response.body, 'missing info about commit message' |
|
10 | assert """Small update at simplevcs app""" in response.body, 'missing info about commit message' | |
12 | assert """<span class="removed" title="removed">0</span>""" in response.body, 'wrong info about removed nodes' |
|
11 | assert """<span class="removed" title="removed">0</span>""" in response.body, 'wrong info about removed nodes' | |
13 | assert """<span class="changed" title="changed">2</span>""" in response.body, 'wrong info about changed nodes' |
|
12 | assert """<span class="changed" title="changed">2</span>""" in response.body, 'wrong info about changed nodes' | |
14 | assert """<span class="added" title="added">1</span>""" in response.body, 'wrong info about added nodes' |
|
13 | assert """<span class="added" title="added">1</span>""" in response.body, 'wrong info about added nodes' | |
15 |
|
14 | |||
16 | #pagination |
|
15 | #pagination | |
17 |
|
16 | |||
18 | response = self.app.get(url(controller='changelog', action='index', repo_name='vcs_test'), {'page':1}) |
|
17 | response = self.app.get(url(controller='changelog', action='index', repo_name='vcs_test'), {'page':1}) | |
19 | response = self.app.get(url(controller='changelog', action='index', repo_name='vcs_test'), {'page':2}) |
|
18 | response = self.app.get(url(controller='changelog', action='index', repo_name='vcs_test'), {'page':2}) | |
20 | response = self.app.get(url(controller='changelog', action='index', repo_name='vcs_test'), {'page':3}) |
|
19 | response = self.app.get(url(controller='changelog', action='index', repo_name='vcs_test'), {'page':3}) | |
@@ -27,5 +26,5 b' class TestChangelogController(TestContro' | |||||
27 | assert """<span class="changed" title="changed">1</span>"""in response.body, 'wrong info about number of changes' |
|
26 | assert """<span class="changed" title="changed">1</span>"""in response.body, 'wrong info about number of changes' | |
28 | assert """<span class="added" title="added">0</span>"""in response.body, 'wrong info about number of added' |
|
27 | assert """<span class="added" title="added">0</span>"""in response.body, 'wrong info about number of added' | |
29 | assert """<div class="date">commit 64: 46ad32a4f974@2010-04-20 00:33:21</div>"""in response.body, 'wrong info about commit 64' |
|
28 | assert """<div class="date">commit 64: 46ad32a4f974@2010-04-20 00:33:21</div>"""in response.body, 'wrong info about commit 64' | |
|
29 | ||||
30 | assert """<div class="message"><a href="/vcs_test/changeset/46ad32a4f974">Merge with 2e6a2bf9356ca56df08807f4ad86d480da72a8f4</a></div>"""in response.body, 'wrong info about commit 64 is a merge' |
|
30 | assert """<div class="message"><a href="/vcs_test/changeset/46ad32a4f974">Merge with 2e6a2bf9356ca56df08807f4ad86d480da72a8f4</a></div>"""in response.body, 'wrong info about commit 64 is a merge' | |
31 |
|
@@ -1,5 +1,5 b'' | |||||
1 | [egg_info] |
|
1 | [egg_info] | |
2 |
tag_build = |
|
2 | tag_build = | |
3 | tag_svn_revision = true |
|
3 | tag_svn_revision = true | |
4 |
|
4 | |||
5 | [easy_install] |
|
5 | [easy_install] |
@@ -4,18 +4,18 b' py_version = sys.version_info' | |||||
4 |
|
4 | |||
5 | requirements = [ |
|
5 | requirements = [ | |
6 | "Pylons>=1.0.0", |
|
6 | "Pylons>=1.0.0", | |
7 |
"SQLAlchemy |
|
7 | "SQLAlchemy==0.6.4", | |
8 | "Mako>=0.3.2", |
|
8 | "Mako>=0.3.2", | |
9 | "vcs==0.1.8", |
|
9 | "vcs==0.1.8", | |
10 | "pygments>=1.3.0", |
|
10 | "pygments>=1.3.0", | |
11 |
"mercurial |
|
11 | "mercurial==1.6.4", | |
12 |
"whoosh==1. |
|
12 | "whoosh==1.2.5", | |
13 |
"celery |
|
13 | "celery==2.1.2", | |
14 | "py-bcrypt", |
|
14 | "py-bcrypt", | |
15 | "babel", |
|
15 | "babel", | |
16 | ] |
|
16 | ] | |
17 |
|
17 | |||
18 |
classifiers = [ |
|
18 | classifiers = ["Development Status :: 5 - Production/Stable", | |
19 | 'Environment :: Web Environment', |
|
19 | 'Environment :: Web Environment', | |
20 | 'Framework :: Pylons', |
|
20 | 'Framework :: Pylons', | |
21 | 'Intended Audience :: Developers', |
|
21 | 'Intended Audience :: Developers', |
General Comments 0
You need to be logged in to leave comments.
Login now