def test_do_GET_responds_with_404_for_non_implemented_requests(): request = MagicMock() handler = RequestHandler(request, ('localhost', 12345), Mock()) handler.send_error = Mock() handler.path = '/dummy_path' handler.do_GET() handler.send_error.assert_called_with(404)
def make_request_handler(): """Constructs request handler with mocked deps and methods. """ request = MagicMock() handler = RequestHandler(request, ('localhost', 12345), Mock()) handler.send_response = Mock() handler.send_header = Mock() handler.end_headers = Mock() handler.wfile = Mock() return handler