summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httpservers.py
diff options
context:
space:
mode:
authorStéphane Wirtel <stephane@wirtel.be>2017-05-24 07:29:06 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2017-05-24 07:29:06 (GMT)
commita17a2f52c4c3b37414da95a152fc8669978c7c83 (patch)
treeabf6327c00ac9ae647474b4b63a704a396ba5a58 /Lib/test/test_httpservers.py
parent07244a83014fad42da937c17d98474b47a570bf7 (diff)
downloadcpython-a17a2f52c4c3b37414da95a152fc8669978c7c83.zip
cpython-a17a2f52c4c3b37414da95a152fc8669978c7c83.tar.gz
cpython-a17a2f52c4c3b37414da95a152fc8669978c7c83.tar.bz2
bpo-28707: Add the directory parameter to http.server.SimpleHTTPRequestHandler and http.server module (#1776)
* bpo-28707: call the constructor of SimpleHTTPRequestHandler in the test with a mock object * bpo-28707: Add the directory parameter to http.server.SimpleHTTPRequestHandler and http.server module
Diffstat (limited to 'Lib/test/test_httpservers.py')
-rw-r--r--Lib/test/test_httpservers.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index dafcb0c..cdc5202 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -22,6 +22,7 @@ import urllib.parse
import tempfile
import time
import datetime
+from unittest import mock
from io import BytesIO
import unittest
@@ -782,7 +783,11 @@ class CGIHTTPServerTestCase(BaseTestCase):
class SocketlessRequestHandler(SimpleHTTPRequestHandler):
- def __init__(self):
+ def __init__(self, *args, **kwargs):
+ request = mock.Mock()
+ request.makefile.return_value = BytesIO()
+ super().__init__(request, None, None)
+
self.get_called = False
self.protocol_version = "HTTP/1.1"