Add a test for a message that is too long

This commit is contained in:
Ian Dees 2015-11-10 11:24:55 -05:00
parent 27e7767883
commit a4e86494e1

View File

@ -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')