Don't include default message to send_error()
Python can provide this for us, so avoid duplication.
This commit is contained in:
@@ -86,7 +86,7 @@ class WebSockifyRequestHandlerTestCase(unittest.TestCase):
|
||||
FakeSocket(b'GET /tmp.txt HTTP/1.1'), '127.0.0.1', server)
|
||||
|
||||
handler.do_GET()
|
||||
send_error.assert_called_with(405, ANY)
|
||||
send_error.assert_called_with(405)
|
||||
|
||||
@patch('websockify.websockifyserver.WebSockifyRequestHandler.send_error')
|
||||
def test_list_dir_with_file_only_returns_error(self, send_error):
|
||||
@@ -96,7 +96,7 @@ class WebSockifyRequestHandlerTestCase(unittest.TestCase):
|
||||
|
||||
handler.path = '/'
|
||||
handler.do_GET()
|
||||
send_error.assert_called_with(404, ANY)
|
||||
send_error.assert_called_with(404)
|
||||
|
||||
|
||||
class WebSockifyServerTestCase(unittest.TestCase):
|
||||
|
||||
@@ -250,13 +250,13 @@ class WebSockifyRequestHandler(WebSocketRequestHandlerMixIn, SimpleHTTPRequestHa
|
||||
self.auth_connection()
|
||||
|
||||
if self.only_upgrade:
|
||||
self.send_error(405, "Method Not Allowed")
|
||||
self.send_error(405)
|
||||
else:
|
||||
super().do_GET()
|
||||
|
||||
def list_directory(self, path):
|
||||
if self.file_only:
|
||||
self.send_error(404, "No such file")
|
||||
self.send_error(404)
|
||||
else:
|
||||
return super().list_directory(path)
|
||||
|
||||
@@ -277,7 +277,7 @@ class WebSockifyRequestHandler(WebSocketRequestHandlerMixIn, SimpleHTTPRequestHa
|
||||
self.auth_connection()
|
||||
|
||||
if self.only_upgrade:
|
||||
self.send_error(405, "Method Not Allowed")
|
||||
self.send_error(405)
|
||||
else:
|
||||
super().do_HEAD()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user