Mercurial > kallithea
changeset 1063:bbddef1e9ef2 beta
fixes and extends file tests
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 19 Feb 2011 00:49:08 +0100 |
parents | 053983a464e4 |
children | 113a8db22852 |
files | rhodecode/tests/functional/test_files.py |
diffstat | 1 files changed, 20 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/tests/functional/test_files.py Thu Feb 17 00:44:45 2011 +0100 +++ b/rhodecode/tests/functional/test_files.py Sat Feb 19 00:49:08 2011 +0100 @@ -246,20 +246,22 @@ repo_name=HG_REPO, revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', f_path='vcs/nodes.py')) - assert False + #print response.body() + #assert False #TODO: put in more + def test_raw_file_wrong_cs(self): self.log_user() - rev = u'ERRORcce30c96924232dffcd24178a07ffeb5dfc' + rev = u'ERRORce30c96924232dffcd24178a07ffeb5dfc' f_path = 'vcs/nodes.py' response = self.app.get(url(controller='files', action='rawfile', repo_name=HG_REPO, - revision='ERRORce30c96924232dffcd24178a07ffeb5dfc', + revision=rev, f_path='vcs/nodes.py')) - print response.session['flash'] - assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0], 'No flash message' - assert """%s""" % (HG_REPO) in response.session['flash'][0], 'No flash message' + + assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0][1], 'No flash message' + assert """%s""" % (HG_REPO) in response.session['flash'][0][1], 'No flash message' @@ -271,7 +273,7 @@ repo_name=HG_REPO, revision=rev, f_path=f_path)) - assert "There is no file nor directory at the given path %r at revision %r" % (f_path, rev) in response.session['flash'][0], 'No flash message' + assert "There is no file nor directory at the given path: %r at revision %r" % (f_path, rev[:12]) in response.session['flash'][0][1], 'No flash message' #========================================================================== # RAW @@ -282,18 +284,23 @@ repo_name=HG_REPO, revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', f_path='vcs/nodes.py')) - assert False + #assert False #TODO: put in more + def test_raw_wrong_cs(self): self.log_user() - rev = 'ERRORcce30c96924232dffcd24178a07ffeb5dfc' + rev = u'ERRORcce30c96924232dffcd24178a07ffeb5dfc' f_path = 'vcs/nodes.py' response = self.app.get(url(controller='files', action='raw', repo_name=HG_REPO, - revision='ERRORce30c96924232dffcd24178a07ffeb5dfc', + revision=rev, f_path='vcs/nodes.py')) - assert "Cannot find revision %s" % rev in response.session['flash'][0], 'No flash message' + + print response.session['flash'][0][1] + assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0][1], 'No flash message' + assert """%s""" % (HG_REPO) in response.session['flash'][0][1], 'No flash message' + def test_raw_wrong_f_path(self): self.log_user() @@ -303,5 +310,6 @@ repo_name=HG_REPO, revision=rev, f_path=f_path)) - assert "There is no file nor directory at the given path %r at revision %r" % (f_path, rev) in response.session['flash'][0], 'No flash message' + assert "There is no file nor directory at the given path: %r at revision %r" % (f_path, rev[:12]) in response.session['flash'][0][1], 'No flash message' +