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
fcdfcea2
Commit
fcdfcea2
authored
Aug 04, 2011
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silence the altered state warning about threadgs when running test_httplib.
parent
5cd25fa8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Lib/test/test_httplib.py
Lib/test/test_httplib.py
+4
-4
No files found.
Lib/test/test_httplib.py
View file @
fcdfcea2
...
@@ -506,8 +506,7 @@ class HTTPSTest(TestCase):
...
@@ -506,8 +506,7 @@ class HTTPSTest(TestCase):
def
test_local_good_hostname
(
self
):
def
test_local_good_hostname
(
self
):
# The (valid) cert validates the HTTP hostname
# The (valid) cert validates the HTTP hostname
import
ssl
import
ssl
from
test.ssl_servers
import
make_https_server
server
=
self
.
make_server
(
CERT_localhost
)
server
=
make_https_server
(
self
,
CERT_localhost
)
context
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
context
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
context
.
verify_mode
=
ssl
.
CERT_REQUIRED
context
.
verify_mode
=
ssl
.
CERT_REQUIRED
context
.
load_verify_locations
(
CERT_localhost
)
context
.
load_verify_locations
(
CERT_localhost
)
...
@@ -515,12 +514,12 @@ class HTTPSTest(TestCase):
...
@@ -515,12 +514,12 @@ class HTTPSTest(TestCase):
h
.
request
(
'GET'
,
'/nonexistent'
)
h
.
request
(
'GET'
,
'/nonexistent'
)
resp
=
h
.
getresponse
()
resp
=
h
.
getresponse
()
self
.
assertEqual
(
resp
.
status
,
404
)
self
.
assertEqual
(
resp
.
status
,
404
)
del
server
def
test_local_bad_hostname
(
self
):
def
test_local_bad_hostname
(
self
):
# The (valid) cert doesn't validate the HTTP hostname
# The (valid) cert doesn't validate the HTTP hostname
import
ssl
import
ssl
from
test.ssl_servers
import
make_https_server
server
=
self
.
make_server
(
CERT_fakehostname
)
server
=
make_https_server
(
self
,
CERT_fakehostname
)
context
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
context
=
ssl
.
SSLContext
(
ssl
.
PROTOCOL_TLSv1
)
context
.
verify_mode
=
ssl
.
CERT_REQUIRED
context
.
verify_mode
=
ssl
.
CERT_REQUIRED
context
.
load_verify_locations
(
CERT_fakehostname
)
context
.
load_verify_locations
(
CERT_fakehostname
)
...
@@ -538,6 +537,7 @@ class HTTPSTest(TestCase):
...
@@ -538,6 +537,7 @@ class HTTPSTest(TestCase):
h
.
request
(
'GET'
,
'/nonexistent'
)
h
.
request
(
'GET'
,
'/nonexistent'
)
resp
=
h
.
getresponse
()
resp
=
h
.
getresponse
()
self
.
assertEqual
(
resp
.
status
,
404
)
self
.
assertEqual
(
resp
.
status
,
404
)
del
server
class
RequestBodyTest
(
TestCase
):
class
RequestBodyTest
(
TestCase
):
...
...
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