mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
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
This commit is contained in:
parent
07244a8301
commit
a17a2f52c4
4 changed files with 37 additions and 5 deletions
|
@ -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"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue