Show More
@@ -246,20 +246,22 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 | assert False |
|
249 | #print response.body() | |
|
250 | #assert False | |||
250 | #TODO: put in more |
|
251 | #TODO: put in more | |
|
252 | ||||
251 | def test_raw_file_wrong_cs(self): |
|
253 | def test_raw_file_wrong_cs(self): | |
252 | self.log_user() |
|
254 | self.log_user() | |
253 |
rev = u'ERRORc |
|
255 | rev = u'ERRORce30c96924232dffcd24178a07ffeb5dfc' | |
254 | f_path = 'vcs/nodes.py' |
|
256 | f_path = 'vcs/nodes.py' | |
255 |
|
257 | |||
256 | response = self.app.get(url(controller='files', action='rawfile', |
|
258 | response = self.app.get(url(controller='files', action='rawfile', | |
257 | repo_name=HG_REPO, |
|
259 | repo_name=HG_REPO, | |
258 |
revision= |
|
260 | revision=rev, | |
259 | f_path='vcs/nodes.py')) |
|
261 | f_path='vcs/nodes.py')) | |
260 | print response.session['flash'] |
|
262 | ||
261 | assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0], 'No flash message' |
|
263 | assert """Revision %r does not exist for this repository""" % (rev) in response.session['flash'][0][1], 'No flash message' | |
262 | assert """%s""" % (HG_REPO) in response.session['flash'][0], 'No flash message' |
|
264 | assert """%s""" % (HG_REPO) in response.session['flash'][0][1], 'No flash message' | |
263 |
|
265 | |||
264 |
|
266 | |||
265 |
|
267 | |||
@@ -271,7 +273,7 b' removed extra unicode conversion in diff' | |||||
271 | repo_name=HG_REPO, |
|
273 | repo_name=HG_REPO, | |
272 | revision=rev, |
|
274 | revision=rev, | |
273 | f_path=f_path)) |
|
275 | f_path=f_path)) | |
274 | 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' |
|
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' | |
275 |
|
277 | |||
276 | #========================================================================== |
|
278 | #========================================================================== | |
277 | # RAW |
|
279 | # RAW | |
@@ -282,18 +284,23 b' removed extra unicode conversion in diff' | |||||
282 | repo_name=HG_REPO, |
|
284 | repo_name=HG_REPO, | |
283 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', |
|
285 | revision='27cd5cce30c96924232dffcd24178a07ffeb5dfc', | |
284 | f_path='vcs/nodes.py')) |
|
286 | f_path='vcs/nodes.py')) | |
285 | assert False |
|
287 | #assert False | |
286 | #TODO: put in more |
|
288 | #TODO: put in more | |
|
289 | ||||
287 | def test_raw_wrong_cs(self): |
|
290 | def test_raw_wrong_cs(self): | |
288 | self.log_user() |
|
291 | self.log_user() | |
289 | rev = 'ERRORcce30c96924232dffcd24178a07ffeb5dfc' |
|
292 | rev = u'ERRORcce30c96924232dffcd24178a07ffeb5dfc' | |
290 | f_path = 'vcs/nodes.py' |
|
293 | f_path = 'vcs/nodes.py' | |
291 |
|
294 | |||
292 | response = self.app.get(url(controller='files', action='raw', |
|
295 | response = self.app.get(url(controller='files', action='raw', | |
293 | repo_name=HG_REPO, |
|
296 | repo_name=HG_REPO, | |
294 |
revision= |
|
297 | revision=rev, | |
295 | f_path='vcs/nodes.py')) |
|
298 | f_path='vcs/nodes.py')) | |
296 | assert "Cannot find revision %s" % rev in response.session['flash'][0], 'No flash message' |
|
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' | |||
|
302 | assert """%s""" % (HG_REPO) in response.session['flash'][0][1], 'No flash message' | |||
|
303 | ||||
297 |
|
304 | |||
298 | def test_raw_wrong_f_path(self): |
|
305 | def test_raw_wrong_f_path(self): | |
299 | self.log_user() |
|
306 | self.log_user() | |
@@ -303,5 +310,6 b' removed extra unicode conversion in diff' | |||||
303 | repo_name=HG_REPO, |
|
310 | repo_name=HG_REPO, | |
304 | revision=rev, |
|
311 | revision=rev, | |
305 | f_path=f_path)) |
|
312 | f_path=f_path)) | |
306 | 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' |
|
|||
307 |
|
313 | |||
|
314 | 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' | |||
|
315 |
General Comments 0
You need to be logged in to leave comments.
Login now