Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
853c0f9d
Commit
853c0f9d
authored
Mar 20, 2013
by
R David Murray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#5713: fix timing issue in smtplib tests.
parent
1f8a40b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
Lib/test/test_smtplib.py
Lib/test/test_smtplib.py
+3
-0
No files found.
Lib/test/test_smtplib.py
View file @
853c0f9d
...
...
@@ -789,6 +789,7 @@ class SMTPSimTests(unittest.TestCase):
# Issue 5713: make sure close, not rset, is called if we get a 421 error
def
test_421_from_mail_cmd
(
self
):
smtp
=
smtplib
.
SMTP
(
HOST
,
self
.
port
,
local_hostname
=
'localhost'
,
timeout
=
15
)
smtp
.
noop
()
self
.
serv
.
_SMTPchannel
.
mail_response
=
'421 closing connection'
with
self
.
assertRaises
(
smtplib
.
SMTPSenderRefused
):
smtp
.
sendmail
(
'John'
,
'Sally'
,
'test message'
)
...
...
@@ -797,6 +798,7 @@ class SMTPSimTests(unittest.TestCase):
def
test_421_from_rcpt_cmd
(
self
):
smtp
=
smtplib
.
SMTP
(
HOST
,
self
.
port
,
local_hostname
=
'localhost'
,
timeout
=
15
)
smtp
.
noop
()
self
.
serv
.
_SMTPchannel
.
rcpt_response
=
[
'250 accepted'
,
'421 closing'
]
with
self
.
assertRaises
(
smtplib
.
SMTPRecipientsRefused
)
as
r
:
smtp
.
sendmail
(
'John'
,
[
'Sally'
,
'Frank'
,
'George'
],
'test message'
)
...
...
@@ -813,6 +815,7 @@ class SMTPSimTests(unittest.TestCase):
super
().
found_terminator
()
self
.
serv
.
channel_class
=
MySimSMTPChannel
smtp
=
smtplib
.
SMTP
(
HOST
,
self
.
port
,
local_hostname
=
'localhost'
,
timeout
=
15
)
smtp
.
noop
()
with
self
.
assertRaises
(
smtplib
.
SMTPDataError
):
smtp
.
sendmail
(
'John@foo.org'
,
[
'Sally@foo.org'
],
'test message'
)
self
.
assertIsNone
(
smtp
.
sock
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment