Skip to content

Commit 27ee353

Browse files
committed
Don't include default message to send_error()
Python can provide this for us, so avoid duplication.
1 parent 39c7cb0 commit 27ee353

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/test_websockifyserver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def test_normal_get_with_only_upgrade_returns_error(self, send_error):
8686
FakeSocket(b'GET /tmp.txt HTTP/1.1'), '127.0.0.1', server)
8787

8888
handler.do_GET()
89-
send_error.assert_called_with(405, ANY)
89+
send_error.assert_called_with(405)
9090

9191
@patch('websockify.websockifyserver.WebSockifyRequestHandler.send_error')
9292
def test_list_dir_with_file_only_returns_error(self, send_error):
@@ -96,7 +96,7 @@ def test_list_dir_with_file_only_returns_error(self, send_error):
9696

9797
handler.path = '/'
9898
handler.do_GET()
99-
send_error.assert_called_with(404, ANY)
99+
send_error.assert_called_with(404)
100100

101101

102102
class WebSockifyServerTestCase(unittest.TestCase):

websockify/websockifyserver.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,13 @@ def do_GET(self):
250250
self.auth_connection()
251251

252252
if self.only_upgrade:
253-
self.send_error(405, "Method Not Allowed")
253+
self.send_error(405)
254254
else:
255255
super().do_GET()
256256

257257
def list_directory(self, path):
258258
if self.file_only:
259-
self.send_error(404, "No such file")
259+
self.send_error(404)
260260
else:
261261
return super().list_directory(path)
262262

@@ -277,7 +277,7 @@ def do_HEAD(self):
277277
self.auth_connection()
278278

279279
if self.only_upgrade:
280-
self.send_error(405, "Method Not Allowed")
280+
self.send_error(405)
281281
else:
282282
super().do_HEAD()
283283

0 commit comments

Comments
 (0)