Skip to content

Commit

Permalink
Add assert for connection closed
Browse files Browse the repository at this point in the history
  • Loading branch information
cole committed Apr 22, 2019
1 parent bbf06c5 commit c6db159
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ async def handle_client(self):
with pytest.raises(SMTPConnectError):
await smtp_client.connect()

smtp_client.close()
assert smtp_client.transport is None
assert smtp_client.protocol is None


async def test_421_closes_connection(
Expand Down
3 changes: 3 additions & 0 deletions tests/test_timeouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ async def test_timeout_error_on_connect(
with pytest.raises(SMTPTimeoutError):
await smtp_client.connect(timeout=0.01)

assert smtp_client.transport is None
assert smtp_client.protocol is None


async def test_timeout_on_initial_read(
smtp_client, smtpd_server, smtpd_class, event_loop, monkeypatch
Expand Down

0 comments on commit c6db159

Please sign in to comment.