def test_ok(response):
    from app.api.Response import Response

    body = {"test": "test"}

    ok_response = Response.ok(body)

    assert ok_response == response
Пример #2
0
def handle(event, context):
    response = sqs.send_message(
        QueueUrl=queue_url,
        MessageBody=event["body"]
    )

    print(response['MessageId'])

    return Response.accepted()
Пример #3
0
def handle(event, context):
    response = sqs.send_message(
        QueueUrl=queue_url,
        MessageBody=event["body"]
    )

    logging.info(f"Message {response['MessageId']} sent to Queue.")

    return Response.accepted()
Пример #4
0
def handle(event, context):
    try:
        id = str(event["queryStringParameters"]["id"])

        coords = repo.find(id)

        return Response.ok(coords)
    except Exception as e:
        logging.error(f"Locating vehicle failed due to {e}.")
Пример #5
0
def handle(event, context):
    body = json.loads(event["body"])

    response = sqs.send_message(QueueUrl=queue_url,
                                MessageBody=json.dumps(body))

    logging.info(f"Message {response['MessageId']} sent to Queue")

    return Response.accepted()
Пример #6
0
def handle(event, context):
    body = json.loads(event["body"])

    response = sqs.send_message(
        QueueUrl=queue_url,
        MessageBody=json.dumps(body)
    )

    print(response['MessageId'])

    return Response.accepted()
Пример #7
0
def handle(event, context):
    id = str(event["queryStringParameters"]["id"])

    coords = repo.find(id)

    return Response.ok(coords)
def test_ok_no_body(response_no_body):
    from app.api.Response import Response

    ok_response = Response.ok()

    assert ok_response == response_no_body