-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle lost connections and EOF during readlines #73
Conversation
Also, add some much improved debugging options for when the test suite is run with the -E option. Update the documentation.
Lift some additional (non-line-length) tests from #59.
I grabbed the few additional non-line-length related tests from #59 although I'm not sure they don't cover cases already covered elsewhere. I just wanted to prove to myself that this PR handles those cases too. I feel pretty good about this one, even if we're not technically handling EOF correctly. It does require checking for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
aiosmtpd/tests/test_smtp.py
Outdated
client.docmd('DATA') | ||
# Start sending the DATA but send an EOF before that completes, | ||
# i.e. before the .\r\n | ||
client.send(b'From: <anne@example.com>\0x4') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be \x04
.
client.helo('example.com') | ||
# Start sending a command but reset the connection before that | ||
# completes, i.e. before the \r\n | ||
client.send('MAIL FROM: <anne') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be a bytestring for consistency with the other tests. (Does SMTP.send
even accept a str?)
Does sending |
@Mortal I think you're right that the |
Oh, also, yes |
Test cases for connection problems during readline()
Also, add some much improved debugging options for when the test suite is run
with the -E option.
Update the documentation.
Closes #61