Skip to content

Commit

Permalink
run black to fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekram committed Nov 1, 2020
1 parent 4fab6de commit 9f5d27c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pyas2lib/as2.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,8 @@ def build(
self.payload.set_payload(data)
self.payload.set_type(content_type)

if content_type.lower().startswith('application/octet-stream'):
self.payload['Content-Transfer-Encoding'] = 'binary'
if content_type.lower().startswith("application/octet-stream"):
self.payload["Content-Transfer-Encoding"] = "binary"
else:
encoders.encode_7or8bit(self.payload)

Expand Down
8 changes: 4 additions & 4 deletions pyas2lib/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def test_mime_to_bytes_unix_text():
"""
message = Message()
message.set_type("application/xml")
message.set_payload('Some line.\nAnother line.')
message.set_payload("Some line.\nAnother line.")

result = utils.mime_to_bytes(message)

Expand All @@ -54,7 +54,7 @@ def test_mime_to_bytes_octet_stream():
"""
message = Message()
message.set_type("application/octet-stream")
message.set_payload('Some line.\nAnother line.\n')
message.set_payload("Some line.\nAnother line.\n")

result = utils.mime_to_bytes(message)

Expand All @@ -73,8 +73,8 @@ def test_mime_to_bytes_binary():
"""
message = Message()
message.set_type("any/type")
message['Content-Transfer-Encoding'] = 'binary'
message.set_payload('Some line.\nAnother line.\n')
message["Content-Transfer-Encoding"] = "binary"
message.set_payload("Some line.\nAnother line.\n")

result = utils.mime_to_bytes(message)

Expand Down
2 changes: 1 addition & 1 deletion pyas2lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def _handle_text(self, msg):
if (
msg.get_content_type() == "application/octet-stream"
or msg.get("Content-Transfer-Encoding") == "binary"
):
):
payload = msg.get_payload(decode=True)
if payload is None:
return
Expand Down

0 comments on commit 9f5d27c

Please sign in to comment.