def test_url1(self):
        """Test with one URL only"""

        self.client.get('/url1')

        # We make sure data processing is complete
        sleep(0.1)

        response = self.client.get('/flstats/')
        self.assertEqual(response.status, '200 OK')

        # Statistics tests
        data = json.loads(response.data)

        stats = data['stats']
        self.assertEqual(len(stats), 1)

        stat = stats.pop()
        self.assertEqual(stat['url'], 'http://localhost/url1')
        self.assertEqual(stat['throughput'], 1)
        self.assertTrue(stat['min'] == stat['avg'] == stat['max'])

        for i in range(0, 9):
            self.client.get('/url1')

        # We make sure data processing is complete
        sleep(0.1)

        response = self.client.get('/flstats/')
        self.assertEqual(response.status, '200 OK')

        # Statistics tests
        data = json.loads(response.data)

        stats = data['stats']
        self.assertEqual(len(stats), 1)

        stat = stats.pop()
        self.assertEqual(stat['url'], 'http://localhost/url1')
        self.assertEqual(stat['throughput'], 9)
        self.assertTrue(stat['min'] <= stat['max'] <= stat['avg'])
dataset/ETHPy150Open yannlambret/flstats/flstats/flstats_tests.py/FlstatsTestCase.test_url1/swapped operands of `<=`