Don't include default message to send_error()

Python can provide this for us, so avoid duplication.
This commit is contained in:
Pierre Ossman
2022-11-16 15:28:18 +01:00
parent 39c7cb0115
commit 27ee353401
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -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):
+3 -3
View File
@@ -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()