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
cb342182
Commit
cb342182
authored
Mar 21, 2011
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to strengthen test_httpservers (issue #11617)
parent
7903cb72
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Lib/test/test_httpservers.py
Lib/test/test_httpservers.py
+4
-4
No files found.
Lib/test/test_httpservers.py
View file @
cb342182
...
@@ -38,8 +38,8 @@ class TestServerThread(threading.Thread):
...
@@ -38,8 +38,8 @@ class TestServerThread(threading.Thread):
self
.
test_object
=
test_object
self
.
test_object
=
test_object
def
run
(
self
):
def
run
(
self
):
self
.
server
=
HTTPServer
((
''
,
0
),
self
.
request_handler
)
self
.
server
=
HTTPServer
((
'
localhost
'
,
0
),
self
.
request_handler
)
self
.
test_object
.
PORT
=
self
.
server
.
socket
.
getsockname
()[
1
]
self
.
test_object
.
HOST
,
self
.
test_object
.
PORT
=
self
.
server
.
socket
.
getsockname
()
self
.
test_object
.
server_started
.
set
()
self
.
test_object
.
server_started
.
set
()
self
.
test_object
=
None
self
.
test_object
=
None
try
:
try
:
...
@@ -66,7 +66,7 @@ class BaseTestCase(unittest.TestCase):
...
@@ -66,7 +66,7 @@ class BaseTestCase(unittest.TestCase):
support
.
threading_cleanup
(
*
self
.
_threads
)
support
.
threading_cleanup
(
*
self
.
_threads
)
def
request
(
self
,
uri
,
method
=
'GET'
,
body
=
None
,
headers
=
{}):
def
request
(
self
,
uri
,
method
=
'GET'
,
body
=
None
,
headers
=
{}):
self
.
connection
=
http
.
client
.
HTTPConnection
(
'localhost'
,
self
.
PORT
)
self
.
connection
=
http
.
client
.
HTTPConnection
(
self
.
HOST
,
self
.
PORT
)
self
.
connection
.
request
(
method
,
uri
,
body
,
headers
)
self
.
connection
.
request
(
method
,
uri
,
body
,
headers
)
return
self
.
connection
.
getresponse
()
return
self
.
connection
.
getresponse
()
...
@@ -107,7 +107,7 @@ class BaseHTTPServerTestCase(BaseTestCase):
...
@@ -107,7 +107,7 @@ class BaseHTTPServerTestCase(BaseTestCase):
def
setUp
(
self
):
def
setUp
(
self
):
BaseTestCase
.
setUp
(
self
)
BaseTestCase
.
setUp
(
self
)
self
.
con
=
http
.
client
.
HTTPConnection
(
'localhost'
,
self
.
PORT
)
self
.
con
=
http
.
client
.
HTTPConnection
(
self
.
HOST
,
self
.
PORT
)
self
.
con
.
connect
()
self
.
con
.
connect
()
def
test_command
(
self
):
def
test_command
(
self
):
...
...
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