Skip to content

Commit

Permalink
Update based on further discussion in #14
Browse files Browse the repository at this point in the history
  • Loading branch information
ehanson8 committed Oct 20, 2021
1 parent c90f8d6 commit 2ac0fac
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion tests/test_sqs.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import boto3
import pytest
from botocore.exceptions import ClientError
from moto import mock_sqs

from awd import sqs


@mock_sqs
def test_sqs_send(sqs_client, dss_message_attributes_example, dss_message_body_example):
def test_sqs_send_success(
sqs_client, dss_message_attributes_example, dss_message_body_example
):
sqs = boto3.resource("sqs", region_name="us-east-1")
sqs_queue = sqs.create_queue(QueueName="mock-queue")
response = sqs_client.send(
Expand All @@ -14,6 +18,17 @@ def test_sqs_send(sqs_client, dss_message_attributes_example, dss_message_body_e
assert response["ResponseMetadata"]["HTTPStatusCode"] == 200


@mock_sqs
def test_sqs_send_failure(
sqs_client, dss_message_attributes_example, dss_message_body_example
):
with pytest.raises(ClientError):
response = sqs_client.send(
"non-existent", dss_message_attributes_example, dss_message_body_example
)
assert response["ResponseMetadata"]["HTTPStatusCode"] == 200


def test_create_dss_message_attributes(dss_message_attributes_example):
dss_message_attributes = sqs.create_dss_message_attributes(
"123", "Submission system", "DSS queue"
Expand Down

0 comments on commit 2ac0fac

Please sign in to comment.