@@ 380-394 (lines=15) @@ | ||
377 | self.assertGreater(len(data['logs']), 0) |
|
378 | self.assertEqual(len(data['follows']), 0) |
|
379 | ||
380 | def test_a70_fetch_via_fetcher(self): |
|
381 | ctx = run.webui.make_context('webui', [ |
|
382 | '--fetcher-rpc', 'http://localhost:24444/', |
|
383 | ], self.ctx) |
|
384 | app = run.webui.invoke(ctx) |
|
385 | app = app.test_client() |
|
386 | rv = app.post('/debug/test_project/run', data={ |
|
387 | 'script': self.script_content, |
|
388 | 'task': self.task_content |
|
389 | }) |
|
390 | self.assertEqual(rv.status_code, 200) |
|
391 | data = json.loads(utils.text(rv.data)) |
|
392 | self.assertEqual(len(data['logs']), 0, data['logs']) |
|
393 | self.assertIn(b'follows', rv.data) |
|
394 | self.assertGreater(len(data['follows']), 0) |
|
395 | ||
396 | def test_h000_auth(self): |
|
397 | ctx = run.webui.make_context('webui', [ |
|
@@ 365-378 (lines=14) @@ | ||
362 | self.assertEqual(rv.status_code, 200) |
|
363 | self.assertIn(b'url,title,url', rv.data) |
|
364 | ||
365 | def test_a60_fetch_via_cannot_connect_fetcher(self): |
|
366 | ctx = run.webui.make_context('webui', [ |
|
367 | '--fetcher-rpc', 'http://localhost:20000/', |
|
368 | ], self.ctx) |
|
369 | app = run.webui.invoke(ctx) |
|
370 | app = app.test_client() |
|
371 | rv = app.post('/debug/test_project/run', data={ |
|
372 | 'script': self.script_content, |
|
373 | 'task': self.task_content |
|
374 | }) |
|
375 | self.assertEqual(rv.status_code, 200) |
|
376 | data = json.loads(utils.text(rv.data)) |
|
377 | self.assertGreater(len(data['logs']), 0) |
|
378 | self.assertEqual(len(data['follows']), 0) |
|
379 | ||
380 | def test_a70_fetch_via_fetcher(self): |
|
381 | ctx = run.webui.make_context('webui', [ |