# HG changeset patch # User Marcin Kuzminski # Date 1298073920 -3600 # Node ID 113a8db2285245814f49d1d63e336e0968ae2e5b # Parent bbddef1e9ef248ee938f1cd6071b6acee5485087 file tests updates + extended the feed tests diff -r bbddef1e9ef2 -r 113a8db22852 rhodecode/tests/functional/test_feed.py --- a/rhodecode/tests/functional/test_feed.py Sat Feb 19 00:49:08 2011 +0100 +++ b/rhodecode/tests/functional/test_feed.py Sat Feb 19 01:05:20 2011 +0100 @@ -6,10 +6,17 @@ self.log_user() response = self.app.get(url(controller='feed', action='rss', repo_name=HG_REPO)) - # Test response... + + + + assert response.content_type == "application/rss+xml" + assert """""" in response def test_atom(self): self.log_user() response = self.app.get(url(controller='feed', action='atom', repo_name=HG_REPO)) - # Test response... \ No newline at end of file + + assert response.content_type == """application/atom+xml""" + assert """""" in response + assert """""" in response diff -r bbddef1e9ef2 -r 113a8db22852 rhodecode/tests/functional/test_files.py --- a/rhodecode/tests/functional/test_files.py Sat Feb 19 00:49:08 2011 +0100 +++ b/rhodecode/tests/functional/test_files.py Sat Feb 19 01:05:20 2011 +0100 @@ -246,9 +246,9 @@ repo_name=HG_REPO, revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', f_path='vcs/nodes.py')) - #print response.body() - #assert False - #TODO: put in more + + assert response.content_disposition == "attachment; filename=nodes.py" + assert response.content_type == "text/x-python" def test_raw_file_wrong_cs(self): self.log_user() @@ -258,7 +258,7 @@ response = self.app.get(url(controller='files', action='rawfile', repo_name=HG_REPO, revision=rev, - f_path='vcs/nodes.py')) + f_path=f_path)) 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' @@ -276,7 +276,7 @@ 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 + # RAW RESPONSE - PLAIN #========================================================================== def test_raw_ok(self): self.log_user() @@ -284,8 +284,8 @@ repo_name=HG_REPO, revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', f_path='vcs/nodes.py')) - #assert False - #TODO: put in more + + assert response.content_type == "text/plain" def test_raw_wrong_cs(self): self.log_user() @@ -295,9 +295,8 @@ response = self.app.get(url(controller='files', action='raw', repo_name=HG_REPO, revision=rev, - f_path='vcs/nodes.py')) + f_path=f_path)) - 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'