summary refs log tree commit diff
path: root/tests/api/test_auth.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-08-22 17:18:28 +0100
committerGitHub <noreply@github.com>2018-08-22 17:18:28 +0100
commita5806aba2751d5a658e657ed489be26869d93f4e (patch)
tree9a9344671dc650b85a5bd42b0fb9d6649ae0834f /tests/api/test_auth.py
parentMerge branch 'master' into develop (diff)
parentMerge branch 'develop' of github.com:matrix-org/synapse into neilj/server_not... (diff)
downloadsynapse-a5806aba2751d5a658e657ed489be26869d93f4e.tar.xz
Merge pull request #3680 from matrix-org/neilj/server_notices_on_blocking
server notices on resource limit blocking
Diffstat (limited to 'tests/api/test_auth.py')
-rw-r--r--tests/api/test_auth.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/api/test_auth.py b/tests/api/test_auth.py
index 022d81ce3e..ed960090c4 100644
--- a/tests/api/test_auth.py
+++ b/tests/api/test_auth.py
@@ -458,7 +458,7 @@ class AuthTestCase(unittest.TestCase):
         with self.assertRaises(ResourceLimitError) as e:
             yield self.auth.check_auth_blocking()
         self.assertEquals(e.exception.admin_uri, self.hs.config.admin_uri)
-        self.assertEquals(e.exception.errcode, Codes.RESOURCE_LIMIT_EXCEED)
+        self.assertEquals(e.exception.errcode, Codes.RESOURCE_LIMIT_EXCEEDED)
         self.assertEquals(e.exception.code, 403)
 
         # Ensure does not throw an error
@@ -474,5 +474,13 @@ class AuthTestCase(unittest.TestCase):
         with self.assertRaises(ResourceLimitError) as e:
             yield self.auth.check_auth_blocking()
         self.assertEquals(e.exception.admin_uri, self.hs.config.admin_uri)
-        self.assertEquals(e.exception.errcode, Codes.RESOURCE_LIMIT_EXCEED)
+        self.assertEquals(e.exception.errcode, Codes.RESOURCE_LIMIT_EXCEEDED)
         self.assertEquals(e.exception.code, 403)
+
+    @defer.inlineCallbacks
+    def test_server_notices_mxid_special_cased(self):
+        self.hs.config.hs_disabled = True
+        user = "@user:server"
+        self.hs.config.server_notices_mxid = user
+        self.hs.config.hs_disabled_message = "Reason for being disabled"
+        yield self.auth.check_auth_blocking(user)