From 9cf7bd451d011b42a2c2bc692047fd8569510f1c Mon Sep 17 00:00:00 2001 From: Brandon Joyce Date: Mon, 27 Nov 2023 16:42:05 -0500 Subject: [PATCH] Formatting --- pyas2lib/as2.py | 7 +++++-- pyas2lib/tests/test_basic.py | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pyas2lib/as2.py b/pyas2lib/as2.py index d81fa1d..12ebac7 100644 --- a/pyas2lib/as2.py +++ b/pyas2lib/as2.py @@ -381,13 +381,16 @@ def build( self.message_id = f"{message_id}@{self.sender.domain}" else: self.message_id = ( - email_utils.make_msgid(domain=self.sender.domain).lstrip("<").rstrip(">") + email_utils.make_msgid(domain=self.sender.domain) + .lstrip("<") + .rstrip(">") ) # ensure the total length of the message id is no more than 255 characters if len(self.message_id) > 255: raise ValueError( - f"Message ID must be no more than 255 characters for compatibility with some AS2 servers. " + "Message ID must be no more than 255 characters for " + "compatibility with some AS2 servers. " f"Current message ID length is {len(self.message_id)}." ) diff --git a/pyas2lib/tests/test_basic.py b/pyas2lib/tests/test_basic.py index aac10fc..fed94b9 100644 --- a/pyas2lib/tests/test_basic.py +++ b/pyas2lib/tests/test_basic.py @@ -219,7 +219,10 @@ def test_invalid_message_id_length_raises_error(self): very_long_message_id = "a" * 1000 with pytest.raises(ValueError) as excinfo: out_message.build(self.test_data, message_id=very_long_message_id) - assert "Message ID must be no more than 255 characters for compatibility" in str(excinfo.value) + assert ( + "Message ID must be no more than 255 characters for compatibility" + in str(excinfo.value) + ) def find_org(self, as2_id): return self.org