@app.route('/api/tests')
def get_tests():
    """Retreive all completed tests"""

    completed_tests = db.get_completed_tests()

    # Apply filters
    try:
        param_from = request.args.get('date_from', None)
        param_to = request.args.get('date_to', None)
        date_from = datetime.fromtimestamp(float(param_from)) if param_from else None
        date_to = datetime.fromtimestamp(float(param_to)) if param_to else None
    except:
        return make_response(jsonify({'error':'Invalid date parameters.'}), 400)

    if date_from:
        completed_tests = [t for t in completed_tests if t['scheduled_date'] >= date_from]
    if date_to:
        completed_tests = [t for t in completed_tests if date_to <= t['scheduled_date']]

    tests = map(lambda t: {
        'test_id': t['test_id'],
        'href': url_for('get_test', test_id=t['test_id'])
    }, completed_tests)

    response = json.dumps(obj=tests)
    return Response(response=response,
                    status=200,
                    mimetype= 'application/json')
dataset/ETHPy150Open datastax/cstar_perf/frontend/cstar_perf/frontend/server/controllers.py/get_tests/swapped operands of `<=`