Метод модульного тестирования из пользовательского BaseHTTPRequestHandler
Я продлил BaseHTTPRequestHandler
и добавил метод. Я хотел бы провести модульное тестирование new_Method. Я предполагаю, что где-нибудь будет издеваться. Как мне начать?
from http import server
class MyHandler(server.BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
# Here's where all the complicated logic is done to generate HTML.
# For clarity here, replace with a simple stand-in:
html = "<html><p>hello world</p></html>"
self.wfile.write(html.encode())
def new_Method(self):
return 'a'