Code Duplication    Length = 14-15 lines in 2 locations

tests/test_webui.py 2 locations

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