escape windows return character (#4729)
This commit is contained in:
parent
a9293d62e3
commit
b7f0dee4a7
@ -150,7 +150,7 @@ class Message(BaseModel):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def body(self):
|
def body(self):
|
||||||
return escape(self._body)
|
return escape(self._body).replace('"', """).replace("\r", "
")
|
||||||
|
|
||||||
def mark_sent(self, delay_seconds=None):
|
def mark_sent(self, delay_seconds=None):
|
||||||
self.sent_timestamp = int(unix_time_millis())
|
self.sent_timestamp = int(unix_time_millis())
|
||||||
|
@ -3455,3 +3455,16 @@ def test_receive_message_again_preserves_attributes():
|
|||||||
assert len(second_messages[0]["MessageAttributes"]) == 2
|
assert len(second_messages[0]["MessageAttributes"]) == 2
|
||||||
assert second_messages[0]["MessageAttributes"].get("Custom1") is not None
|
assert second_messages[0]["MessageAttributes"].get("Custom1") is not None
|
||||||
assert second_messages[0]["MessageAttributes"].get("Custom2") is not None
|
assert second_messages[0]["MessageAttributes"].get("Custom2") is not None
|
||||||
|
|
||||||
|
|
||||||
|
@mock_sqs
|
||||||
|
def test_message_has_windows_return():
|
||||||
|
sqs = boto3.resource("sqs", region_name="us-east-1")
|
||||||
|
queue = sqs.create_queue(QueueName=f"{str(uuid4())[0:6]}")
|
||||||
|
|
||||||
|
message = "content:\rmessage_with line"
|
||||||
|
queue.send_message(MessageBody=message)
|
||||||
|
|
||||||
|
messages = queue.receive_messages()
|
||||||
|
messages.should.have.length_of(1)
|
||||||
|
messages[0].body.should.match(message)
|
||||||
|
Loading…
Reference in New Issue
Block a user