@@ 380-394 (lines=15) @@ | ||
377 | self.assertEqual(len(data), 1) |
|
378 | ||
379 | def test_a40_export_url_json(self): |
|
380 | rv = self.app.get('/results/dump/test_project.txt') |
|
381 | self.assertEqual(rv.status_code, 200) |
|
382 | self.assertIn(b'"url":', rv.data) |
|
383 | ||
384 | def test_a50_export_csv(self): |
|
385 | rv = self.app.get('/results/dump/test_project.csv') |
|
386 | self.assertEqual(rv.status_code, 200) |
|
387 | self.assertIn(b'url,title,url', rv.data) |
|
388 | ||
389 | def test_a60_fetch_via_cannot_connect_fetcher(self): |
|
390 | ctx = run.webui.make_context('webui', [ |
|
391 | '--fetcher-rpc', 'http://localhost:20000/', |
|
392 | ], self.ctx) |
|
393 | app = run.webui.invoke(ctx) |
|
394 | app = app.test_client() |
|
395 | rv = app.post('/debug/test_project/run', data={ |
|
396 | 'script': self.script_content, |
|
397 | 'task': self.task_content |
|
@@ 365-378 (lines=14) @@ | ||
362 | def test_a30_export_json(self): |
|
363 | rv = self.app.get('/results/dump/test_project.json') |
|
364 | self.assertEqual(rv.status_code, 200) |
|
365 | self.assertIn(b'"taskid":', rv.data) |
|
366 | ||
367 | def test_a32_export_json_style_full(self): |
|
368 | rv = self.app.get('/results/dump/test_project.json?style=full') |
|
369 | self.assertEqual(rv.status_code, 200) |
|
370 | data = json.loads(rv.data.decode('utf8')) |
|
371 | self.assertGreater(len(data), 1) |
|
372 | ||
373 | def test_a34_export_json_style_full_limit_1(self): |
|
374 | rv = self.app.get('/results/dump/test_project.json?style=full&limit=1&offset=1') |
|
375 | self.assertEqual(rv.status_code, 200) |
|
376 | data = json.loads(rv.data.decode('utf8')) |
|
377 | self.assertEqual(len(data), 1) |
|
378 | ||
379 | def test_a40_export_url_json(self): |
|
380 | rv = self.app.get('/results/dump/test_project.txt') |
|
381 | self.assertEqual(rv.status_code, 200) |