Skip to content

Commit

Permalink
Blackification
Browse files Browse the repository at this point in the history
  • Loading branch information
pepoluan committed Mar 8, 2021
1 parent 9b355f4 commit 2b83d6b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion aiosmtpd/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(self, loop: asyncio.AbstractEventLoop):
)

def _client_connected_cb(
self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter
self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter
) -> None:
pass

Expand Down
2 changes: 1 addition & 1 deletion aiosmtpd/lmtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class LMTP(SMTP):
show_smtp_greeting: bool = False

@syntax('LHLO hostname')
@syntax("LHLO hostname")
async def smtp_LHLO(self, arg: str) -> None:
"""The LMTP greeting, used instead of HELO/EHLO."""
await super().smtp_EHLO(arg)
Expand Down
2 changes: 1 addition & 1 deletion aiosmtpd/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def _parser() -> ArgumentParser:
action="count",
help=(
"Increase debugging output. Every ``-d`` increases debugging level by one."
)
),
)
parser.add_argument(
"-l",
Expand Down
6 changes: 3 additions & 3 deletions aiosmtpd/tests/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ class TestMessage:
bytearray(),
"",
],
ids=["bytes", "bytearray", "str"]
ids=["bytes", "bytearray", "str"],
)
def test_prepare_message(self, temp_event_loop, content):
sess_ = ServerSession(temp_event_loop)
Expand All @@ -460,7 +460,7 @@ def test_prepare_message(self, temp_event_loop, content):
enve_.content = content
msg = handler.prepare_message(sess_, enve_)
assert isinstance(msg, Em_Message)
assert msg.keys() == ['X-Peer', 'X-MailFrom', 'X-RcptTo']
assert msg.keys() == ["X-Peer", "X-MailFrom", "X-RcptTo"]
assert msg.get_payload() == ""

@pytest.mark.parametrize(
Expand All @@ -471,7 +471,7 @@ def test_prepare_message(self, temp_event_loop, content):
({}, r"Expected str or bytes, got <class 'dict'>"),
((), r"Expected str or bytes, got <class 'tuple'>"),
],
ids=("None", "List", "Dict", "Tuple")
ids=("None", "List", "Dict", "Tuple"),
)
def test_prepare_message_err(self, temp_event_loop, content, expectre):
sess_ = ServerSession(temp_event_loop)
Expand Down
8 changes: 2 additions & 6 deletions aiosmtpd/tests/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,7 @@ def test_unixsocket(self, safe_socket_dir, autostop_loop, runner):
with pytest.raises((socket.timeout, ConnectionError)):
assert_smtp_socket(cont)

@pytest.mark.filterwarnings(
"ignore::pytest.PytestUnraisableExceptionWarning"
)
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
def test_inet_loopstop(self, autostop_loop, runner):
"""
Verify behavior when the loop is stopped before controller is stopped
Expand Down Expand Up @@ -485,9 +483,7 @@ def test_inet_loopstop(self, autostop_loop, runner):
with pytest.raises((socket.timeout, ConnectionError)):
SMTPClient(cont.hostname, cont.port, timeout=0.1)

@pytest.mark.filterwarnings(
"ignore::pytest.PytestUnraisableExceptionWarning"
)
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
def test_inet_contstop(self, temp_event_loop, runner):
"""
Verify behavior when the controller is stopped before loop is stopped
Expand Down
11 changes: 3 additions & 8 deletions aiosmtpd/tests/test_smtp.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,7 @@ def authenticator_peeker_controller(

@pytest.fixture
def decoding_authnotls_controller(
get_handler: Callable,
get_controller: Callable[..., Controller]
get_handler: Callable, get_controller: Callable[..., Controller]
) -> Generator[Controller, None, None]:
handler = get_handler()
controller = get_controller(
Expand Down Expand Up @@ -994,9 +993,7 @@ def test_auth_loginteract_warning(self, client):
@pytest.mark.usefixtures("auth_peeker_controller")
class TestAuthMechanisms(_CommonMethods):
@pytest.fixture
def do_auth_plain1(
self, client
) -> Callable[[str], Tuple[int, bytes]]:
def do_auth_plain1(self, client) -> Callable[[str], Tuple[int, bytes]]:
self._ehlo(client)

def do(param: str) -> Tuple[int, bytes]:
Expand All @@ -1006,9 +1003,7 @@ def do(param: str) -> Tuple[int, bytes]:
return do

@pytest.fixture
def do_auth_login3(
self, client
) -> Callable[[str], Tuple[int, bytes]]:
def do_auth_login3(self, client) -> Callable[[str], Tuple[int, bytes]]:
self._ehlo(client)
resp = client.docmd("AUTH LOGIN")
assert resp == S.S334_AUTH_USERNAME
Expand Down

0 comments on commit 2b83d6b

Please sign in to comment.