Incorporate review

pull/5115/head
Brendan Abolivier 2019-05-09 13:07:43 +01:00
parent 532ba44add
commit f304f1a574
3 changed files with 6 additions and 5 deletions

View File

@ -388,7 +388,7 @@ class IdentityHandler(BaseHandler):
@defer.inlineCallbacks
def bulk_lookup_3pid(self, id_server, threepids):
"""Looks up a 3pid in the passed identity server.
"""Looks up given 3pids in the passed identity server.
Args:
id_server (str): The server name (including port, if required)

View File

@ -15,6 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
import re
from six.moves import http_client
@ -482,11 +483,10 @@ class ThreepidDeleteRestServlet(RestServlet):
class ThreepidLookupRestServlet(RestServlet):
PATTERNS = client_v2_patterns("/account/3pid/lookup$")
PATTERNS = [re.compile("^/_matrix/client/unstable/account/3pid/lookup$")]
def __init__(self, hs):
super(ThreepidLookupRestServlet, self).__init__()
self.config = hs.config
self.auth = hs.get_auth()
self.identity_handler = hs.get_handlers().identity_handler
@ -514,11 +514,10 @@ class ThreepidLookupRestServlet(RestServlet):
class ThreepidBulkLookupRestServlet(RestServlet):
PATTERNS = client_v2_patterns("/account/3pid/bulk_lookup$")
PATTERNS = [re.compile("^/_matrix/client/unstable/account/3pid/bulk_lookup$")]
def __init__(self, hs):
super(ThreepidBulkLookupRestServlet, self).__init__()
self.config = hs.config
self.auth = hs.get_auth()
self.identity_handler = hs.get_handlers().identity_handler

View File

@ -26,6 +26,7 @@ from tests import unittest
class IdentityDisabledTestCase(unittest.HomeserverTestCase):
"""Tests that 3PID lookup attempts fail when the HS's config disallows them."""
servlets = [
account.register_servlets,
@ -104,6 +105,7 @@ class IdentityDisabledTestCase(unittest.HomeserverTestCase):
class IdentityEnabledTestCase(unittest.HomeserverTestCase):
"""Tests that 3PID lookup attempts succeed when the HS's config allows them."""
servlets = [
account.register_servlets,