Code Duplication    Length = 14-15 lines in 2 locations

tests/test_webui.py 2 locations

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