1 { elasticmq-server, python3Packages, runCommand, writeText}:
3 runCommand "${elasticmq-server.name}-tests" (let
6 client = boto3.resource(
8 endpoint_url="http://localhost:9324",
9 region_name="elasticmq",
10 aws_secret_access_key="x",
11 aws_access_key_id="x",
14 queue = client.get_queue_by_name(QueueName="foobar")
17 buildInputs = with python3Packages; [ python boto3 ];
18 emqConfig = writeText "emq-test.conf" ''
19 generate-node-address = true
25 putMessagePy = writeText "put_message.py" ''
27 queue.send_message(MessageBody="bazqux")
29 checkMessagePy = writeText "check_message.py" ''
31 messages = queue.receive_messages()
32 print(f"Received {messages!r}")
33 assert len(messages) == 1
34 assert messages[0].body == "bazqux"
37 JAVA_TOOL_OPTIONS="-Dconfig.file=$emqConfig" ${elasticmq-server}/bin/elasticmq-server &
42 python $checkMessagePy