@@ -58,7 +58,7 @@ def test_no_auth(self, method: str) -> None:
5858 channel = self .make_request (method , self .url , b"{}" )
5959
6060 self .assertEqual (
61- HTTPStatus . UNAUTHORIZED ,
61+ 401 ,
6262 channel .code ,
6363 msg = channel .json_body ,
6464 )
@@ -76,7 +76,7 @@ def test_requester_is_no_admin(self, method: str) -> None:
7676 )
7777
7878 self .assertEqual (
79- HTTPStatus . FORBIDDEN ,
79+ 403 ,
8080 channel .code ,
8181 msg = channel .json_body ,
8282 )
@@ -85,7 +85,7 @@ def test_requester_is_no_admin(self, method: str) -> None:
8585 @parameterized .expand (["GET" , "PUT" , "DELETE" ])
8686 def test_user_does_not_exist (self , method : str ) -> None :
8787 """
88- Tests that a lookup for a user that does not exist returns a HTTPStatus.NOT_FOUND
88+ Tests that a lookup for a user that does not exist returns a 404
8989 """
9090 url = (
9191 "/_synapse/admin/v2/users/@unknown_person:test/devices/%s"
@@ -98,7 +98,7 @@ def test_user_does_not_exist(self, method: str) -> None:
9898 access_token = self .admin_user_tok ,
9999 )
100100
101- self .assertEqual (HTTPStatus . NOT_FOUND , channel .code , msg = channel .json_body )
101+ self .assertEqual (404 , channel .code , msg = channel .json_body )
102102 self .assertEqual (Codes .NOT_FOUND , channel .json_body ["errcode" ])
103103
104104 @parameterized .expand (["GET" , "PUT" , "DELETE" ])
@@ -122,7 +122,7 @@ def test_user_is_not_local(self, method: str) -> None:
122122
123123 def test_unknown_device (self ) -> None :
124124 """
125- Tests that a lookup for a device that does not exist returns either HTTPStatus.NOT_FOUND or 200.
125+ Tests that a lookup for a device that does not exist returns either 404 or 200.
126126 """
127127 url = "/_synapse/admin/v2/users/%s/devices/unknown_device" % urllib .parse .quote (
128128 self .other_user
@@ -134,7 +134,7 @@ def test_unknown_device(self) -> None:
134134 access_token = self .admin_user_tok ,
135135 )
136136
137- self .assertEqual (HTTPStatus . NOT_FOUND , channel .code , msg = channel .json_body )
137+ self .assertEqual (404 , channel .code , msg = channel .json_body )
138138 self .assertEqual (Codes .NOT_FOUND , channel .json_body ["errcode" ])
139139
140140 channel = self .make_request (
@@ -312,7 +312,7 @@ def test_no_auth(self) -> None:
312312 channel = self .make_request ("GET" , self .url , b"{}" )
313313
314314 self .assertEqual (
315- HTTPStatus . UNAUTHORIZED ,
315+ 401 ,
316316 channel .code ,
317317 msg = channel .json_body ,
318318 )
@@ -331,15 +331,15 @@ def test_requester_is_no_admin(self) -> None:
331331 )
332332
333333 self .assertEqual (
334- HTTPStatus . FORBIDDEN ,
334+ 403 ,
335335 channel .code ,
336336 msg = channel .json_body ,
337337 )
338338 self .assertEqual (Codes .FORBIDDEN , channel .json_body ["errcode" ])
339339
340340 def test_user_does_not_exist (self ) -> None :
341341 """
342- Tests that a lookup for a user that does not exist returns a HTTPStatus.NOT_FOUND
342+ Tests that a lookup for a user that does not exist returns a 404
343343 """
344344 url = "/_synapse/admin/v2/users/@unknown_person:test/devices"
345345 channel = self .make_request (
@@ -348,7 +348,7 @@ def test_user_does_not_exist(self) -> None:
348348 access_token = self .admin_user_tok ,
349349 )
350350
351- self .assertEqual (HTTPStatus . NOT_FOUND , channel .code , msg = channel .json_body )
351+ self .assertEqual (404 , channel .code , msg = channel .json_body )
352352 self .assertEqual (Codes .NOT_FOUND , channel .json_body ["errcode" ])
353353
354354 def test_user_is_not_local (self ) -> None :
@@ -438,7 +438,7 @@ def test_no_auth(self) -> None:
438438 channel = self .make_request ("POST" , self .url , b"{}" )
439439
440440 self .assertEqual (
441- HTTPStatus . UNAUTHORIZED ,
441+ 401 ,
442442 channel .code ,
443443 msg = channel .json_body ,
444444 )
@@ -457,15 +457,15 @@ def test_requester_is_no_admin(self) -> None:
457457 )
458458
459459 self .assertEqual (
460- HTTPStatus . FORBIDDEN ,
460+ 403 ,
461461 channel .code ,
462462 msg = channel .json_body ,
463463 )
464464 self .assertEqual (Codes .FORBIDDEN , channel .json_body ["errcode" ])
465465
466466 def test_user_does_not_exist (self ) -> None :
467467 """
468- Tests that a lookup for a user that does not exist returns a HTTPStatus.NOT_FOUND
468+ Tests that a lookup for a user that does not exist returns a 404
469469 """
470470 url = "/_synapse/admin/v2/users/@unknown_person:test/delete_devices"
471471 channel = self .make_request (
@@ -474,7 +474,7 @@ def test_user_does_not_exist(self) -> None:
474474 access_token = self .admin_user_tok ,
475475 )
476476
477- self .assertEqual (HTTPStatus . NOT_FOUND , channel .code , msg = channel .json_body )
477+ self .assertEqual (404 , channel .code , msg = channel .json_body )
478478 self .assertEqual (Codes .NOT_FOUND , channel .json_body ["errcode" ])
479479
480480 def test_user_is_not_local (self ) -> None :
0 commit comments