##// END OF EJS Templates
file tests updates + extended the feed tests
marcink -
r1064:113a8db2 beta
parent child Browse files
Show More
@@ -6,10 +6,17 b' class TestFeedController(TestController)'
6 self.log_user()
6 self.log_user()
7 response = self.app.get(url(controller='feed', action='rss',
7 response = self.app.get(url(controller='feed', action='rss',
8 repo_name=HG_REPO))
8 repo_name=HG_REPO))
9 # Test response...
9
10
11
12 assert response.content_type == "application/rss+xml"
13 assert """<rss version="2.0">""" in response
10
14
11 def test_atom(self):
15 def test_atom(self):
12 self.log_user()
16 self.log_user()
13 response = self.app.get(url(controller='feed', action='atom',
17 response = self.app.get(url(controller='feed', action='atom',
14 repo_name=HG_REPO))
18 repo_name=HG_REPO))
15 # Test response... No newline at end of file
19
20 assert response.content_type == """application/atom+xml"""
21 assert """<?xml version="1.0" encoding="utf-8"?>""" in response
22 assert """<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us">""" in response
@@ -246,9 +246,9 b' removed extra unicode conversion in diff'
246 repo_name=HG_REPO,
246 repo_name=HG_REPO,
247 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
247 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
248 f_path='vcs/nodes.py'))
248 f_path='vcs/nodes.py'))
249 #print response.body()
249
250 #assert False
250 assert response.content_disposition == "attachment; filename=nodes.py"
251 #TODO: put in more
251 assert response.content_type == "text/x-python"
252
252
253 def test_raw_file_wrong_cs(self):
253 def test_raw_file_wrong_cs(self):
254 self.log_user()
254 self.log_user()
@@ -258,7 +258,7 b' removed extra unicode conversion in diff'
258 response = self.app.get(url(controller='files', action='rawfile',
258 response = self.app.get(url(controller='files', action='rawfile',
259 repo_name=HG_REPO,
259 repo_name=HG_REPO,
260 revision=rev,
260 revision=rev,
261 f_path='vcs/nodes.py'))
261 f_path=f_path))
262
262
263 assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0][1], 'No flash message'
263 assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0][1], 'No flash message'
264 assert """%s""" % (HG_REPO) in response.session['flash'][0][1], 'No flash message'
264 assert """%s""" % (HG_REPO) in response.session['flash'][0][1], 'No flash message'
@@ -276,7 +276,7 b' removed extra unicode conversion in diff'
276 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'
276 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'
277
277
278 #==========================================================================
278 #==========================================================================
279 # RAW
279 # RAW RESPONSE - PLAIN
280 #==========================================================================
280 #==========================================================================
281 def test_raw_ok(self):
281 def test_raw_ok(self):
282 self.log_user()
282 self.log_user()
@@ -284,8 +284,8 b' removed extra unicode conversion in diff'
284 repo_name=HG_REPO,
284 repo_name=HG_REPO,
285 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
285 revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc',
286 f_path='vcs/nodes.py'))
286 f_path='vcs/nodes.py'))
287 #assert False
287
288 #TODO: put in more
288 assert response.content_type == "text/plain"
289
289
290 def test_raw_wrong_cs(self):
290 def test_raw_wrong_cs(self):
291 self.log_user()
291 self.log_user()
@@ -295,9 +295,8 b' removed extra unicode conversion in diff'
295 response = self.app.get(url(controller='files', action='raw',
295 response = self.app.get(url(controller='files', action='raw',
296 repo_name=HG_REPO,
296 repo_name=HG_REPO,
297 revision=rev,
297 revision=rev,
298 f_path='vcs/nodes.py'))
298 f_path=f_path))
299
299
300 print response.session['flash'][0][1]
301 assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0][1], 'No flash message'
300 assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0][1], 'No flash message'
302 assert """%s""" % (HG_REPO) in response.session['flash'][0][1], 'No flash message'
301 assert """%s""" % (HG_REPO) in response.session['flash'][0][1], 'No flash message'
303
302
General Comments 0
You need to be logged in to leave comments. Login now