summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMatthew Hodgson <matthew@matrix.org>2018-01-07 23:45:55 +0000
committerHubert Chathi <hubert@uhoreg.ca>2018-08-12 19:14:31 -0400
commit66a4ca1d28c2c2e22a0343e6db0f5a2bce9ec987 (patch)
treeea8c66b93abafb3446fbb8a3b40d48cc0f0f7fb9 /tests
parentsupport DELETE /version with no args (diff)
downloadsynapse-66a4ca1d28c2c2e22a0343e6db0f5a2bce9ec987.tar.xz
404 nicely if you try to interact with a missing current version
Diffstat (limited to 'tests')
-rw-r--r--tests/handlers/test_e2e_room_keys.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/handlers/test_e2e_room_keys.py b/tests/handlers/test_e2e_room_keys.py
index 6e43543ed9..8bfffb5c0e 100644
--- a/tests/handlers/test_e2e_room_keys.py
+++ b/tests/handlers/test_e2e_room_keys.py
@@ -124,6 +124,28 @@ class E2eRoomKeysHandlerTestCase(unittest.TestCase):
         })
 
     @defer.inlineCallbacks
+    def test_delete_missing_version(self):
+        """Check that we get a 404 on deleting nonexistent versions
+        """
+        res = None
+        try:
+            yield self.handler.delete_version(self.local_user, "1")
+        except errors.SynapseError as e:
+            res = e.code
+        self.assertEqual(res, 404)
+
+    @defer.inlineCallbacks
+    def test_delete_missing_current_version(self):
+        """Check that we get a 404 on deleting nonexistent current version
+        """
+        res = None
+        try:
+            yield self.handler.delete_version(self.local_user)
+        except errors.SynapseError as e:
+            res = e.code
+        self.assertEqual(res, 404)
+
+    @defer.inlineCallbacks
     def test_delete_version(self):
         """Check that we can create and then delete versions.
         """