from rhodecode.tests import *
class TestChangelogController(TestController):
def test_index_hg(self):
self.log_user()
response = self.app.get(url(controller='changelog', action='index',
repo_name=HG_REPO))
response.mustcontain('''id="chg_20" class="container tablerow1"''')
response.mustcontain(
""""""
)
response.mustcontain(
"""r154:5e204e7583b9"""
)
response.mustcontain("""Small update at simplevcs app""")
# response.mustcontain(
# """
3
"""
# )
def test_index_pagination_hg(self):
self.log_user()
#pagination
self.app.get(url(controller='changelog', action='index',
repo_name=HG_REPO), {'page': 1})
self.app.get(url(controller='changelog', action='index',
repo_name=HG_REPO), {'page': 2})
self.app.get(url(controller='changelog', action='index',
repo_name=HG_REPO), {'page': 3})
self.app.get(url(controller='changelog', action='index',
repo_name=HG_REPO), {'page': 4})
self.app.get(url(controller='changelog', action='index',
repo_name=HG_REPO), {'page': 5})
response = self.app.get(url(controller='changelog', action='index',
repo_name=HG_REPO), {'page': 6})
# Test response after pagination...
response.mustcontain(
""""""
)
response.mustcontain(
"""r64:46ad32a4f974"""
)
# response.mustcontain(
# """21
"""
# )
#
# response.mustcontain(
# """"""
# """46ad32a4f974""" % HG_REPO
# )
def test_index_git(self):
self.log_user()
response = self.app.get(url(controller='changelog', action='index',
repo_name=GIT_REPO))
response.mustcontain('''id="chg_20" class="container tablerow1"''')
response.mustcontain(
""""""
)
response.mustcontain(
"""r613:95f9a91d775b"""
)
response.mustcontain("""fixing stupid typo in context for mercurial""")
# response.mustcontain(
# """3
"""
# )
def test_index_pagination_git(self):
self.log_user()
#pagination
self.app.get(url(controller='changelog', action='index',
repo_name=GIT_REPO), {'page': 1})
self.app.get(url(controller='changelog', action='index',
repo_name=GIT_REPO), {'page': 2})
self.app.get(url(controller='changelog', action='index',
repo_name=GIT_REPO), {'page': 3})
self.app.get(url(controller='changelog', action='index',
repo_name=GIT_REPO), {'page': 4})
self.app.get(url(controller='changelog', action='index',
repo_name=GIT_REPO), {'page': 5})
response = self.app.get(url(controller='changelog', action='index',
repo_name=GIT_REPO), {'page': 6})
# Test response after pagination...
response.mustcontain(
""""""
)
response.mustcontain(
"""r515:636ed213f2f1"""
)
def test_index_hg_with_filenode(self):
self.log_user()
response = self.app.get(url(controller='changelog', action='index',
revision='tip', f_path='/vcs/exceptions.py',
repo_name=HG_REPO))
#history commits messages
response.mustcontain('Added exceptions module, this time for real')
response.mustcontain('Added not implemented hg backend test case')
response.mustcontain('Added BaseChangeset class')
# Test response...
def test_index_git_with_filenode(self):
self.log_user()
response = self.app.get(url(controller='changelog', action='index',
revision='tip', f_path='/vcs/exceptions.py',
repo_name=GIT_REPO))
#history commits messages
response.mustcontain('Added exceptions module, this time for real')
response.mustcontain('Added not implemented hg backend test case')
response.mustcontain('Added BaseChangeset class')
def test_index_hg_with_filenode_that_is_dirnode(self):
self.log_user()
response = self.app.get(url(controller='changelog', action='index',
revision='tip', f_path='/tests',
repo_name=HG_REPO))
self.assertEqual(response.status, '302 Found')
def test_index_git_with_filenode_that_is_dirnode(self):
self.log_user()
response = self.app.get(url(controller='changelog', action='index',
revision='tip', f_path='/tests',
repo_name=GIT_REPO))
self.assertEqual(response.status, '302 Found')
def test_index_hg_with_filenode_not_existing(self):
self.log_user()
response = self.app.get(url(controller='changelog', action='index',
revision='tip', f_path='/wrong_path',
repo_name=HG_REPO))
self.assertEqual(response.status, '302 Found')
def test_index_git_with_filenode_not_existing(self):
self.log_user()
response = self.app.get(url(controller='changelog', action='index',
revision='tip', f_path='/wrong_path',
repo_name=GIT_REPO))
self.assertEqual(response.status, '302 Found')