Flatten the synapse.rest.client package (#10600)

pull/10630/head
reivilibre 2021-08-17 12:57:58 +01:00 committed by GitHub
parent b62eba7705
commit 642a42edde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
123 changed files with 137 additions and 188 deletions

1
changelog.d/10600.misc Normal file
View File

@ -0,0 +1 @@
Flatten the `synapse.rest.client` package by moving the contents of `v1` and `v2_alpha` into the parent.

View File

@ -66,40 +66,40 @@ from synapse.replication.slave.storage.receipts import SlavedReceiptsStore
from synapse.replication.slave.storage.registration import SlavedRegistrationStore
from synapse.replication.slave.storage.room import RoomStore
from synapse.rest.admin import register_servlets_for_media_repo
from synapse.rest.client.v1 import events, login, presence, room
from synapse.rest.client.v1.initial_sync import InitialSyncRestServlet
from synapse.rest.client.v1.profile import (
ProfileAvatarURLRestServlet,
ProfileDisplaynameRestServlet,
ProfileRestServlet,
)
from synapse.rest.client.v1.push_rule import PushRuleRestServlet
from synapse.rest.client.v1.voip import VoipRestServlet
from synapse.rest.client.v2_alpha import (
from synapse.rest.client import (
account_data,
events,
groups,
login,
presence,
read_marker,
receipts,
room,
room_keys,
sync,
tags,
user_directory,
)
from synapse.rest.client.v2_alpha._base import client_patterns
from synapse.rest.client.v2_alpha.account import ThreepidRestServlet
from synapse.rest.client.v2_alpha.account_data import (
AccountDataServlet,
RoomAccountDataServlet,
)
from synapse.rest.client.v2_alpha.devices import DevicesRestServlet
from synapse.rest.client.v2_alpha.keys import (
from synapse.rest.client._base import client_patterns
from synapse.rest.client.account import ThreepidRestServlet
from synapse.rest.client.account_data import AccountDataServlet, RoomAccountDataServlet
from synapse.rest.client.devices import DevicesRestServlet
from synapse.rest.client.initial_sync import InitialSyncRestServlet
from synapse.rest.client.keys import (
KeyChangesServlet,
KeyQueryServlet,
OneTimeKeyServlet,
)
from synapse.rest.client.v2_alpha.register import RegisterRestServlet
from synapse.rest.client.v2_alpha.sendtodevice import SendToDeviceRestServlet
from synapse.rest.client.profile import (
ProfileAvatarURLRestServlet,
ProfileDisplaynameRestServlet,
ProfileRestServlet,
)
from synapse.rest.client.push_rule import PushRuleRestServlet
from synapse.rest.client.register import RegisterRestServlet
from synapse.rest.client.sendtodevice import SendToDeviceRestServlet
from synapse.rest.client.versions import VersionsRestServlet
from synapse.rest.client.voip import VoipRestServlet
from synapse.rest.health import HealthResource
from synapse.rest.key.v2 import KeyApiV2Resource
from synapse.rest.synapse.client import build_synapse_client_resource_tree

View File

@ -73,7 +73,7 @@ from synapse.util.stringutils import base62_encode
from synapse.util.threepids import canonicalise_email
if TYPE_CHECKING:
from synapse.rest.client.v1.login import LoginResponse
from synapse.rest.client.login import LoginResponse
from synapse.server import HomeServer
logger = logging.getLogger(__name__)
@ -461,7 +461,7 @@ class AuthHandler(BaseHandler):
If no auth flows have been completed successfully, raises an
InteractiveAuthIncompleteError. To handle this, you can use
synapse.rest.client.v2_alpha._base.interactive_auth_handler as a
synapse.rest.client._base.interactive_auth_handler as a
decorator.
Args:
@ -543,7 +543,7 @@ class AuthHandler(BaseHandler):
# Note that the registration endpoint explicitly removes the
# "initial_device_display_name" parameter if it is provided
# without a "password" parameter. See the changes to
# synapse.rest.client.v2_alpha.register.RegisterRestServlet.on_POST
# synapse.rest.client.register.RegisterRestServlet.on_POST
# in commit 544722bad23fc31056b9240189c3cbbbf0ffd3f9.
if not clientdict:
clientdict = session.clientdict

View File

@ -14,40 +14,36 @@
# limitations under the License.
from synapse.http.server import JsonResource
from synapse.rest import admin
from synapse.rest.client import versions
from synapse.rest.client.v1 import (
directory,
events,
initial_sync,
login as v1_login,
logout,
presence,
profile,
push_rule,
pusher,
room,
voip,
)
from synapse.rest.client.v2_alpha import (
from synapse.rest.client import (
account,
account_data,
account_validity,
auth,
capabilities,
devices,
directory,
events,
filter,
groups,
initial_sync,
keys,
knock,
login as v1_login,
logout,
notifications,
openid,
password_policy,
presence,
profile,
push_rule,
pusher,
read_marker,
receipts,
register,
relations,
report_event,
room as roomv2,
room,
room_batch,
room_keys,
room_upgrade_rest_servlet,
sendtodevice,
@ -57,6 +53,8 @@ from synapse.rest.client.v2_alpha import (
thirdparty,
tokenrefresh,
user_directory,
versions,
voip,
)
@ -85,7 +83,6 @@ class ClientRestResource(JsonResource):
# Partially deprecated in r0
events.register_servlets(hs, client_resource)
# "v1" + "r0"
room.register_servlets(hs, client_resource)
v1_login.register_servlets(hs, client_resource)
profile.register_servlets(hs, client_resource)
@ -95,8 +92,6 @@ class ClientRestResource(JsonResource):
pusher.register_servlets(hs, client_resource)
push_rule.register_servlets(hs, client_resource)
logout.register_servlets(hs, client_resource)
# "v2"
sync.register_servlets(hs, client_resource)
filter.register_servlets(hs, client_resource)
account.register_servlets(hs, client_resource)
@ -118,7 +113,7 @@ class ClientRestResource(JsonResource):
user_directory.register_servlets(hs, client_resource)
groups.register_servlets(hs, client_resource)
room_upgrade_rest_servlet.register_servlets(hs, client_resource)
roomv2.register_servlets(hs, client_resource)
room_batch.register_servlets(hs, client_resource)
capabilities.register_servlets(hs, client_resource)
account_validity.register_servlets(hs, client_resource)
relations.register_servlets(hs, client_resource)

View File

@ -34,7 +34,7 @@ from synapse.rest.admin._base import (
assert_requester_is_admin,
assert_user_is_admin,
)
from synapse.rest.client.v2_alpha._base import client_patterns
from synapse.rest.client._base import client_patterns
from synapse.storage.databases.main.media_repository import MediaSortOrder
from synapse.storage.databases.main.stats import UserSortOrder
from synapse.types import JsonDict, UserID
@ -504,7 +504,7 @@ class UserRegisterServlet(RestServlet):
raise SynapseError(403, "HMAC incorrect")
# Reuse the parts of RegisterRestServlet to reduce code duplication
from synapse.rest.client.v2_alpha.register import RegisterRestServlet
from synapse.rest.client.register import RegisterRestServlet
register = RegisterRestServlet(self.hs)

View File

@ -1,4 +1,4 @@
# Copyright 2015, 2016 OpenMarket Ltd
# Copyright 2014-2016 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.

View File

@ -23,7 +23,7 @@ from synapse.api.errors import (
SynapseError,
)
from synapse.http.servlet import RestServlet, parse_json_object_from_request
from synapse.rest.client.v2_alpha._base import client_patterns
from synapse.rest.client._base import client_patterns
from synapse.types import RoomAlias
logger = logging.getLogger(__name__)

View File

@ -17,7 +17,7 @@ import logging
from synapse.api.errors import SynapseError
from synapse.http.servlet import RestServlet
from synapse.rest.client.v2_alpha._base import client_patterns
from synapse.rest.client._base import client_patterns
from synapse.streams.config import PaginationConfig
logger = logging.getLogger(__name__)

View File

@ -14,7 +14,7 @@
from synapse.http.servlet import RestServlet, parse_boolean
from synapse.rest.client.v2_alpha._base import client_patterns
from synapse.rest.client._base import client_patterns
from synapse.streams.config import PaginationConfig

View File

@ -34,7 +34,7 @@ from synapse.http.servlet import (
parse_string,
)
from synapse.http.site import SynapseRequest
from synapse.rest.client.v2_alpha._base import client_patterns
from synapse.rest.client._base import client_patterns
from synapse.rest.well_known import WellKnownBuilder
from synapse.types import JsonDict, UserID

View File

@ -15,7 +15,7 @@
import logging
from synapse.http.servlet import RestServlet
from synapse.rest.client.v2_alpha._base import client_patterns
from synapse.rest.client._base import client_patterns
logger = logging.getLogger(__name__)

View File

@ -19,7 +19,7 @@ import logging
from synapse.api.errors import AuthError, SynapseError
from synapse.handlers.presence import format_user_presence_state
from synapse.http.servlet import RestServlet, parse_json_object_from_request
from synapse.rest.client.v2_alpha._base import client_patterns
from synapse.rest.client._base import client_patterns
from synapse.types import UserID
logger = logging.getLogger(__name__)

View File

@ -16,7 +16,7 @@
from synapse.api.errors import Codes, SynapseError
from synapse.http.servlet import RestServlet, parse_json_object_from_request
from synapse.rest.client.v2_alpha._base import client_patterns
from synapse.rest.client._base import client_patterns
from synapse.types import UserID

View File

@ -26,7 +26,7 @@ from synapse.http.servlet import (
from synapse.push.baserules import BASE_RULE_IDS, NEW_RULE_IDS
from synapse.push.clientformat import format_push_rules_for_user
from synapse.push.rulekinds import PRIORITY_CLASS_MAP
from synapse.rest.client.v2_alpha._base import client_patterns
from synapse.rest.client._base import client_patterns
from synapse.storage.push_rule import InconsistentRuleException, RuleNotFoundException

View File

@ -23,7 +23,7 @@ from synapse.http.servlet import (
parse_string,
)
from synapse.push import PusherConfigException
from synapse.rest.client.v2_alpha._base import client_patterns
from synapse.rest.client._base import client_patterns
logger = logging.getLogger(__name__)

View File

@ -115,7 +115,7 @@ class EmailRegisterRequestTokenRestServlet(RestServlet):
# For emails, canonicalise the address.
# We store all email addresses canonicalised in the DB.
# (See on_POST in EmailThreepidRequestTokenRestServlet
# in synapse/rest/client/v2_alpha/account.py)
# in synapse/rest/client/account.py)
try:
email = validate_email(body["email"])
except ValueError as e:
@ -631,7 +631,7 @@ class RegisterRestServlet(RestServlet):
# For emails, canonicalise the address.
# We store all email addresses canonicalised in the DB.
# (See on_POST in EmailThreepidRequestTokenRestServlet
# in synapse/rest/client/v2_alpha/account.py)
# in synapse/rest/client/account.py)
if medium == "email":
try:
address = canonicalise_email(address)

View File

@ -42,8 +42,8 @@ from synapse.http.servlet import (
)
from synapse.http.site import SynapseRequest
from synapse.logging.opentracing import set_tag
from synapse.rest.client._base import client_patterns
from synapse.rest.client.transactions import HttpTransactionCache
from synapse.rest.client.v2_alpha._base import client_patterns
from synapse.storage.state import StateFilter
from synapse.streams.config import PaginationConfig
from synapse.types import JsonDict, StreamToken, ThirdPartyInstanceID, UserID

View File

@ -1,13 +0,0 @@
# Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View File

@ -1,13 +0,0 @@
# Copyright 2014-2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

View File

@ -17,7 +17,7 @@ import hashlib
import hmac
from synapse.http.servlet import RestServlet
from synapse.rest.client.v2_alpha._base import client_patterns
from synapse.rest.client._base import client_patterns
class VoipRestServlet(RestServlet):

View File

@ -1,6 +1,6 @@
import synapse
from synapse.app.phone_stats_home import start_phone_stats_home
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from tests import unittest
from tests.unittest import HomeserverTestCase

View File

@ -22,7 +22,7 @@ from synapse.federation.units import Transaction
from synapse.handlers.presence import UserPresenceState
from synapse.module_api import ModuleApi
from synapse.rest import admin
from synapse.rest.client.v1 import login, presence, room
from synapse.rest.client import login, presence, room
from synapse.types import JsonDict, StreamToken, create_requester
from tests.handlers.test_sync import generate_sync_config

View File

@ -14,7 +14,7 @@
from synapse.events.snapshot import EventContext
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from tests import unittest
from tests.test_utils.event_injection import create_event

View File

@ -16,7 +16,7 @@ from unittest.mock import Mock
from synapse.api.errors import Codes, SynapseError
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from synapse.types import UserID
from tests import unittest

View File

@ -6,7 +6,7 @@ from synapse.events import EventBase
from synapse.federation.sender import PerDestinationQueue, TransactionManager
from synapse.federation.units import Edu
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from synapse.util.retryutils import NotRetryingDestination
from tests.test_utils import event_injection, make_awaitable

View File

@ -21,7 +21,7 @@ from twisted.internet import defer
from synapse.api.constants import RoomEncryptionAlgorithms
from synapse.rest import admin
from synapse.rest.client.v1 import login
from synapse.rest.client import login
from synapse.types import JsonDict, ReadReceipt
from tests.test_utils import make_awaitable

View File

@ -19,7 +19,7 @@ from parameterized import parameterized
from synapse.events import make_event_from_dict
from synapse.federation.federation_server import server_matches_acl_event
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from tests import unittest

View File

@ -18,7 +18,7 @@ from synapse.api.constants import EventTypes, JoinRules, Membership
from synapse.api.room_versions import RoomVersions
from synapse.events import builder
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from synapse.server import HomeServer
from synapse.types import RoomAlias

View File

@ -15,12 +15,10 @@
from collections import Counter
from unittest.mock import Mock
import synapse.api.errors
import synapse.handlers.admin
import synapse.rest.admin
import synapse.storage
from synapse.api.constants import EventTypes
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from tests import unittest

View File

@ -19,7 +19,7 @@ import synapse
import synapse.api.errors
from synapse.api.constants import EventTypes
from synapse.config.room_directory import RoomDirectoryConfig
from synapse.rest.client.v1 import directory, login, room
from synapse.rest.client import directory, login, room
from synapse.types import RoomAlias, create_requester
from tests import unittest

View File

@ -22,7 +22,7 @@ from synapse.events import EventBase
from synapse.federation.federation_base import event_from_pdu_json
from synapse.logging.context import LoggingContext, run_in_background
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from synapse.util.stringutils import random_string
from tests import unittest

View File

@ -18,7 +18,7 @@ from synapse.api.constants import EventTypes
from synapse.events import EventBase
from synapse.events.snapshot import EventContext
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from synapse.types import create_requester
from synapse.util.stringutils import random_string

View File

@ -20,8 +20,7 @@ from unittest.mock import Mock
from twisted.internet import defer
import synapse
from synapse.rest.client.v1 import login
from synapse.rest.client.v2_alpha import devices
from synapse.rest.client import devices, login
from synapse.types import JsonDict
from tests import unittest

View File

@ -33,7 +33,7 @@ from synapse.handlers.presence import (
handle_update,
)
from synapse.rest import admin
from synapse.rest.client.v1 import room
from synapse.rest.client import room
from synapse.types import UserID, get_domain_from_id
from tests import unittest

View File

@ -28,7 +28,7 @@ from synapse.api.room_versions import RoomVersions
from synapse.events import make_event_from_dict
from synapse.handlers.room_summary import _child_events_comparison_key, _RoomEntry
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from synapse.server import HomeServer
from synapse.types import JsonDict, UserID

View File

@ -13,7 +13,7 @@
# limitations under the License.
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from synapse.storage.databases.main import stats
from tests import unittest

View File

@ -18,8 +18,7 @@ from twisted.internet import defer
import synapse.rest.admin
from synapse.api.constants import EventTypes, RoomEncryptionAlgorithms, UserTypes
from synapse.api.room_versions import RoomVersion, RoomVersions
from synapse.rest.client.v1 import login, room
from synapse.rest.client.v2_alpha import user_directory
from synapse.rest.client import login, room, user_directory
from synapse.storage.roommember import ProfileInfo
from tests import unittest

View File

@ -20,7 +20,7 @@ from synapse.events import EventBase
from synapse.federation.units import Transaction
from synapse.handlers.presence import UserPresenceState
from synapse.rest import admin
from synapse.rest.client.v1 import login, presence, room
from synapse.rest.client import login, presence, room
from synapse.types import create_requester
from tests.events.test_presence_router import send_presence_update, sync_presence

View File

@ -21,7 +21,7 @@ from twisted.internet.defer import Deferred
import synapse.rest.admin
from synapse.api.errors import Codes, SynapseError
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from tests.unittest import HomeserverTestCase

View File

@ -18,8 +18,7 @@ from twisted.internet.defer import Deferred
import synapse.rest.admin
from synapse.logging.context import make_deferred_yieldable
from synapse.push import PusherConfigException
from synapse.rest.client.v1 import login, room
from synapse.rest.client.v2_alpha import receipts
from synapse.rest.client import login, receipts, room
from tests.unittest import HomeserverTestCase, override_config

View File

@ -24,7 +24,7 @@ from synapse.replication.tcp.streams.events import (
EventsStreamRow,
)
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from tests.replication._base import BaseStreamTestCase
from tests.test_utils.event_injection import inject_event, inject_member_event

View File

@ -13,7 +13,7 @@
# limitations under the License.
import logging
from synapse.rest.client.v2_alpha import register
from synapse.rest.client import register
from tests.replication._base import BaseMultiWorkerStreamTestCase
from tests.server import FakeChannel, make_request

View File

@ -13,7 +13,7 @@
# limitations under the License.
import logging
from synapse.rest.client.v2_alpha import register
from synapse.rest.client import register
from tests.replication._base import BaseMultiWorkerStreamTestCase
from tests.server import make_request

View File

@ -17,7 +17,7 @@ from unittest.mock import Mock
from synapse.api.constants import EventTypes, Membership
from synapse.events.builder import EventBuilderFactory
from synapse.rest.admin import register_servlets_for_client_rest_resource
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from synapse.types import UserID, create_requester
from tests.replication._base import BaseMultiWorkerStreamTestCase

View File

@ -22,7 +22,7 @@ from twisted.web.http import HTTPChannel
from twisted.web.server import Request
from synapse.rest import admin
from synapse.rest.client.v1 import login
from synapse.rest.client import login
from synapse.server import HomeServer
from tests.http import TestServerTLSConnectionFactory, get_test_ca_cert_file

View File

@ -17,7 +17,7 @@ from unittest.mock import Mock
from twisted.internet import defer
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from tests.replication._base import BaseMultiWorkerStreamTestCase

View File

@ -16,8 +16,7 @@ from unittest.mock import patch
from synapse.api.room_versions import RoomVersion
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client.v2_alpha import sync
from synapse.rest.client import login, room, sync
from tests.replication._base import BaseMultiWorkerStreamTestCase
from tests.server import make_request

View File

@ -24,8 +24,7 @@ import synapse.rest.admin
from synapse.http.server import JsonResource
from synapse.logging.context import make_deferred_yieldable
from synapse.rest.admin import VersionServlet
from synapse.rest.client.v1 import login, room
from synapse.rest.client.v2_alpha import groups
from synapse.rest.client import groups, login, room
from tests import unittest
from tests.server import FakeSite, make_request

View File

@ -17,7 +17,7 @@ import urllib.parse
import synapse.rest.admin
from synapse.api.errors import Codes
from synapse.rest.client.v1 import login
from synapse.rest.client import login
from tests import unittest

View File

@ -16,8 +16,7 @@ import json
import synapse.rest.admin
from synapse.api.errors import Codes
from synapse.rest.client.v1 import login, room
from synapse.rest.client.v2_alpha import report_event
from synapse.rest.client import login, report_event, room
from tests import unittest

View File

@ -20,7 +20,7 @@ from parameterized import parameterized
import synapse.rest.admin
from synapse.api.errors import Codes
from synapse.rest.client.v1 import login, profile, room
from synapse.rest.client import login, profile, room
from synapse.rest.media.v1.filepath import MediaFilePaths
from tests import unittest

View File

@ -22,7 +22,7 @@ from parameterized import parameterized_class
import synapse.rest.admin
from synapse.api.constants import EventTypes, Membership
from synapse.api.errors import Codes
from synapse.rest.client.v1 import directory, events, login, room
from synapse.rest.client import directory, events, login, room
from tests import unittest

View File

@ -18,7 +18,7 @@ from typing import Any, Dict, List, Optional
import synapse.rest.admin
from synapse.api.errors import Codes
from synapse.rest.client.v1 import login
from synapse.rest.client import login
from tests import unittest

View File

@ -27,8 +27,7 @@ import synapse.rest.admin
from synapse.api.constants import UserTypes
from synapse.api.errors import Codes, HttpResponseException, ResourceLimitError
from synapse.api.room_versions import RoomVersions
from synapse.rest.client.v1 import login, logout, profile, room
from synapse.rest.client.v2_alpha import devices, sync
from synapse.rest.client import devices, login, logout, profile, room, sync
from synapse.rest.media.v1.filepath import MediaFilePaths
from synapse.types import JsonDict, UserID

View File

@ -14,7 +14,7 @@
import synapse.rest.admin
from synapse.api.errors import Codes, SynapseError
from synapse.rest.client.v1 import login
from synapse.rest.client import login
from tests import unittest

View File

@ -16,7 +16,7 @@ import os
import synapse.rest.admin
from synapse.api.urls import ConsentURIBuilder
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from synapse.rest.consent import consent_resource
from tests import unittest

View File

@ -13,7 +13,7 @@
# limitations under the License.
from synapse.api.constants import EventContentFields, EventTypes
from synapse.rest import admin
from synapse.rest.client.v1 import room
from synapse.rest.client import room
from tests import unittest

View File

@ -15,7 +15,7 @@
import json
import synapse.rest.admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from tests import unittest

View File

@ -13,8 +13,7 @@
# limitations under the License.
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client.v2_alpha import sync
from synapse.rest.client import login, room, sync
from tests.unittest import HomeserverTestCase

View File

@ -13,8 +13,7 @@
# limitations under the License.
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client.v2_alpha import sync
from synapse.rest.client import login, room, sync
from tests.unittest import HomeserverTestCase

View File

@ -15,7 +15,7 @@ from unittest.mock import Mock
from synapse.api.constants import EventTypes
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from synapse.visibility import filter_events_for_client
from tests import unittest

View File

@ -16,8 +16,13 @@ from unittest.mock import Mock, patch
import synapse.rest.admin
from synapse.api.constants import EventTypes
from synapse.rest.client.v1 import directory, login, profile, room
from synapse.rest.client.v2_alpha import room_upgrade_rest_servlet
from synapse.rest.client import (
directory,
login,
profile,
room,
room_upgrade_rest_servlet,
)
from synapse.types import UserID
from tests import unittest

View File

@ -19,7 +19,7 @@ from synapse.events import EventBase
from synapse.events.third_party_rules import load_legacy_third_party_event_rules
from synapse.module_api import ModuleApi
from synapse.rest import admin
from synapse.rest.client.v1 import login, room
from synapse.rest.client import login, room
from synapse.types import Requester, StateMap
from synapse.util.frozenutils import unfreeze

View File

@ -15,7 +15,7 @@
import json
from synapse.rest import admin
from synapse.rest.client.v1 import directory, login, room
from synapse.rest.client import directory, login, room
from synapse.types import RoomAlias
from synapse.util.stringutils import random_string

View File

@ -17,7 +17,7 @@
from unittest.mock import Mock
import synapse.rest.admin
from synapse.rest.client.v1 import events, login, room
from synapse.rest.client import events, login, room
from tests import unittest

View File

@ -24,9 +24,8 @@ from twisted.web.resource import Resource
import synapse.rest.admin
from synapse.appservice import ApplicationService
from synapse.rest.client.v1 import login, logout
from synapse.rest.client.v2_alpha import devices, register
from synapse.rest.client.v2_alpha.account import WhoamiRestServlet
from synapse.rest.client import devices, login, logout, register
from synapse.rest.client.account import WhoamiRestServlet
from synapse.rest.synapse.client import build_synapse_client_resource_tree
from synapse.types import create_requester

View File

@ -17,7 +17,7 @@ from unittest.mock import Mock
from twisted.internet import defer
from synapse.handlers.presence import PresenceHandler
from synapse.rest.client.v1 import presence
from synapse.rest.client import presence
from synapse.types import UserID
from tests import unittest

View File

@ -14,7 +14,7 @@
"""Tests REST events for /profile paths."""
from synapse.rest import admin
from synapse.rest.client.v1 import login, profile, room
from synapse.rest.client import login, profile, room
from tests import unittest

View File

@ -13,7 +13,7 @@
# limitations under the License.
import synapse
from synapse.api.errors import Codes
from synapse.rest.client.v1 import login, push_rule, room
from synapse.rest.client import login, push_rule, room
from tests.unittest import HomeserverTestCase

View File

@ -29,8 +29,7 @@ from synapse.api.constants import EventContentFields, EventTypes, Membership
from synapse.api.errors import HttpResponseException
from synapse.handlers.pagination import PurgeStatus
from synapse.rest import admin
from synapse.rest.client.v1 import directory, login, profile, room
from synapse.rest.client.v2_alpha import account
from synapse.rest.client import account, directory, login, profile, room
from synapse.types import JsonDict, RoomAlias, UserID, create_requester
from synapse.util.stringutils import random_string

View File

@ -17,7 +17,7 @@
from unittest.mock import Mock
from synapse.rest.client.v1 import room
from synapse.rest.client import room
from synapse.types import UserID
from tests import unittest

View File

@ -25,8 +25,7 @@ import synapse.rest.admin
from synapse.api.constants import LoginType, Membership
from synapse.api.errors import Codes, HttpResponseException
from synapse.appservice import ApplicationService
from synapse.rest.client.v1 import login, room
from synapse.rest.client.v2_alpha import account, register
from synapse.rest.client import account, login, register, room
from synapse.rest.synapse.client.password_reset import PasswordResetSubmitTokenResource
from tests import unittest

Some files were not shown because too many files have changed in this diff Show More