From 357b8e2fa47aee99cd2878ee90557af00ab0d643 Mon Sep 17 00:00:00 2001 From: Jeremy Prevost Date: Wed, 13 Oct 2021 15:21:33 -0400 Subject: [PATCH] Address code review feedback - updates `create-queue` to take an argument name instead of an option - updates argument names for sample data loader --- README.md | 5 +++-- submitter/cli.py | 7 ++++--- tests/test_cli.py | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 30e7cbe..cea6494 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,11 @@ will be helpful to understand how to create and run commands. It is often desireable to use [Moto](https://github.com/spulec/moto) for local development using the [Standalone Server Mode(https://github.com/spulec/moto#stand-alone-server-mode)] rather than using true AWS SQS queues. To use, start moto running sqs in standalone mode with `pipenv run moto_server`, then: + - add `SQS_ENDPOINT_URL='http://localhost:5000'` to your `.env` file - create the queues you'd like to use - - pipenv run submitter create-queue --name=YOUR_INPUT_QUEUE - - pipenv run submitter create-queue --name=YOUR_OUTPUT_QUEUE + - pipenv run submitter create-queue YOUR_INPUT_QUEUE + - pipenv run submitter create-queue YOUR_OUTPUT_QUEUE While this provides local SQS queues, please note it does not provide local DSpace so you currently still need to use the test server and real credentials. diff --git a/submitter/cli.py b/submitter/cli.py index 03aa6cf..4b0aaae 100644 --- a/submitter/cli.py +++ b/submitter/cli.py @@ -27,12 +27,12 @@ def start(queue, wait): @main.command() @click.option( - "--input_queue", + "--input-queue", default=config.INPUT_QUEUE, help="Name of queue to load sample messages to", ) @click.option( - "--output_queue", + "--output-queue", help="Name of queue to send output messages to", ) def sample_data_loader(input_queue, output_queue): @@ -42,7 +42,8 @@ def sample_data_loader(input_queue, output_queue): @main.command() -@click.option("--name", help="name of queue to create") +@click.argument("name") def create_queue(name): + """Create queue with NAME supplied as argument""" queue = create(name) logger.info(queue.url) diff --git a/tests/test_cli.py b/tests/test_cli.py index 048c09d..1f59a51 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -14,9 +14,9 @@ def test_cli_sample_data_loader(mocked_sqs): main, [ "sample-data-loader", - "--input_queue", + "--input-queue", "empty_input_queue", - "--output_queue", + "--output-queue", "empty_result_queue", ], )