From a4e86494e13960fe604fa18bc92fbf17ec4390eb Mon Sep 17 00:00:00 2001 From: Ian Dees Date: Tue, 10 Nov 2015 11:24:55 -0500 Subject: [PATCH] Add a test for a message that is too long --- tests/test_sqs/test_sqs.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_sqs/test_sqs.py b/tests/test_sqs/test_sqs.py index a23545dc..43ab21d5 100644 --- a/tests/test_sqs/test_sqs.py +++ b/tests/test_sqs/test_sqs.py @@ -170,6 +170,18 @@ def test_send_message_with_delay(): queue.count().should.equal(0) +@mock_sqs +def test_send_large_message_fails(): + conn = boto.connect_sqs('the_key', 'the_secret') + queue = conn.create_queue("test-queue", visibility_timeout=60) + queue.set_message_class(RawMessage) + + body_one = 'test message' * 20000 + huge_message = queue.new_message(body_one) + + queue.write.when.called_with(huge_message).should.throw(SQSError) + + @mock_sqs def test_message_becomes_inflight_when_received(): conn = boto.connect_sqs('the_key', 'the_secret')