@@ -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 HTTPStatus.OK .
125+ Tests that a lookup for a device that does not exist returns either HTTPStatus.NOT_FOUND or 200 .
126126 """
127127 url = "/_synapse/admin/v2/users/%s/devices/unknown_device" % urllib .parse .quote (
128128 self .other_user
@@ -143,16 +143,16 @@ def test_unknown_device(self) -> None:
143143 access_token = self .admin_user_tok ,
144144 )
145145
146- self .assertEqual (HTTPStatus . OK , channel .code , msg = channel .json_body )
146+ self .assertEqual (200 , channel .code , msg = channel .json_body )
147147
148148 channel = self .make_request (
149149 "DELETE" ,
150150 url ,
151151 access_token = self .admin_user_tok ,
152152 )
153153
154- # Delete unknown device returns status HTTPStatus.OK
155- self .assertEqual (HTTPStatus . OK , channel .code , msg = channel .json_body )
154+ # Delete unknown device returns status 200
155+ self .assertEqual (200 , channel .code , msg = channel .json_body )
156156
157157 def test_update_device_too_long_display_name (self ) -> None :
158158 """
@@ -189,12 +189,12 @@ def test_update_device_too_long_display_name(self) -> None:
189189 access_token = self .admin_user_tok ,
190190 )
191191
192- self .assertEqual (HTTPStatus . OK , channel .code , msg = channel .json_body )
192+ self .assertEqual (200 , channel .code , msg = channel .json_body )
193193 self .assertEqual ("new display" , channel .json_body ["display_name" ])
194194
195195 def test_update_no_display_name (self ) -> None :
196196 """
197- Tests that a update for a device without JSON returns a HTTPStatus.OK
197+ Tests that a update for a device without JSON returns a 200
198198 """
199199 # Set iniital display name.
200200 update = {"display_name" : "new display" }
@@ -210,7 +210,7 @@ def test_update_no_display_name(self) -> None:
210210 access_token = self .admin_user_tok ,
211211 )
212212
213- self .assertEqual (HTTPStatus . OK , channel .code , msg = channel .json_body )
213+ self .assertEqual (200 , channel .code , msg = channel .json_body )
214214
215215 # Ensure the display name was not updated.
216216 channel = self .make_request (
@@ -219,7 +219,7 @@ def test_update_no_display_name(self) -> None:
219219 access_token = self .admin_user_tok ,
220220 )
221221
222- self .assertEqual (HTTPStatus . OK , channel .code , msg = channel .json_body )
222+ self .assertEqual (200 , channel .code , msg = channel .json_body )
223223 self .assertEqual ("new display" , channel .json_body ["display_name" ])
224224
225225 def test_update_display_name (self ) -> None :
@@ -234,7 +234,7 @@ def test_update_display_name(self) -> None:
234234 content = {"display_name" : "new displayname" },
235235 )
236236
237- self .assertEqual (HTTPStatus . OK , channel .code , msg = channel .json_body )
237+ self .assertEqual (200 , channel .code , msg = channel .json_body )
238238
239239 # Check new display_name
240240 channel = self .make_request (
@@ -243,7 +243,7 @@ def test_update_display_name(self) -> None:
243243 access_token = self .admin_user_tok ,
244244 )
245245
246- self .assertEqual (HTTPStatus . OK , channel .code , msg = channel .json_body )
246+ self .assertEqual (200 , channel .code , msg = channel .json_body )
247247 self .assertEqual ("new displayname" , channel .json_body ["display_name" ])
248248
249249 def test_get_device (self ) -> None :
@@ -256,7 +256,7 @@ def test_get_device(self) -> None:
256256 access_token = self .admin_user_tok ,
257257 )
258258
259- self .assertEqual (HTTPStatus . OK , channel .code , msg = channel .json_body )
259+ self .assertEqual (200 , channel .code , msg = channel .json_body )
260260 self .assertEqual (self .other_user , channel .json_body ["user_id" ])
261261 # Check that all fields are available
262262 self .assertIn ("user_id" , channel .json_body )
@@ -281,7 +281,7 @@ def test_delete_device(self) -> None:
281281 access_token = self .admin_user_tok ,
282282 )
283283
284- self .assertEqual (HTTPStatus . OK , channel .code , msg = channel .json_body )
284+ self .assertEqual (200 , channel .code , msg = channel .json_body )
285285
286286 # Ensure that the number of devices is decreased
287287 res = self .get_success (self .handler .get_devices_by_user (self .other_user ))
@@ -379,7 +379,7 @@ def test_user_has_no_devices(self) -> None:
379379 access_token = self .admin_user_tok ,
380380 )
381381
382- self .assertEqual (HTTPStatus . OK , channel .code , msg = channel .json_body )
382+ self .assertEqual (200 , channel .code , msg = channel .json_body )
383383 self .assertEqual (0 , channel .json_body ["total" ])
384384 self .assertEqual (0 , len (channel .json_body ["devices" ]))
385385
@@ -399,7 +399,7 @@ def test_get_devices(self) -> None:
399399 access_token = self .admin_user_tok ,
400400 )
401401
402- self .assertEqual (HTTPStatus . OK , channel .code , msg = channel .json_body )
402+ self .assertEqual (200 , channel .code , msg = channel .json_body )
403403 self .assertEqual (number_devices , channel .json_body ["total" ])
404404 self .assertEqual (number_devices , len (channel .json_body ["devices" ]))
405405 self .assertEqual (self .other_user , channel .json_body ["devices" ][0 ]["user_id" ])
@@ -494,7 +494,7 @@ def test_user_is_not_local(self) -> None:
494494
495495 def test_unknown_devices (self ) -> None :
496496 """
497- Tests that a remove of a device that does not exist returns HTTPStatus.OK .
497+ Tests that a remove of a device that does not exist returns 200 .
498498 """
499499 channel = self .make_request (
500500 "POST" ,
@@ -503,8 +503,8 @@ def test_unknown_devices(self) -> None:
503503 content = {"devices" : ["unknown_device1" , "unknown_device2" ]},
504504 )
505505
506- # Delete unknown devices returns status HTTPStatus.OK
507- self .assertEqual (HTTPStatus . OK , channel .code , msg = channel .json_body )
506+ # Delete unknown devices returns status 200
507+ self .assertEqual (200 , channel .code , msg = channel .json_body )
508508
509509 def test_delete_devices (self ) -> None :
510510 """
@@ -533,7 +533,7 @@ def test_delete_devices(self) -> None:
533533 content = {"devices" : device_ids },
534534 )
535535
536- self .assertEqual (HTTPStatus . OK , channel .code , msg = channel .json_body )
536+ self .assertEqual (200 , channel .code , msg = channel .json_body )
537537
538538 res = self .get_success (self .handler .get_devices_by_user (self .other_user ))
539539 self .assertEqual (0 , len (res ))
0 commit comments