Skip to content

Commit

Permalink
Address code review feedback
Browse files Browse the repository at this point in the history
- updates `create-queue` to take an argument name instead of an option
- updates argument names for sample data loader
  • Loading branch information
JPrevost committed Oct 13, 2021
1 parent bd47a90 commit 357b8e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
7 changes: 4 additions & 3 deletions submitter/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
4 changes: 2 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)
Expand Down

0 comments on commit 357b8e2

Please sign in to comment.