Pārlūkot izejas kodu

Use mock from the stdlib. (#9772)

tags/v1.32.0rc1
Patrick Cloke pirms 3 gadiem
committed by GitHub
vecāks
revīzija
0b3112123d
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: 4AEE18F83AFDEB23
82 mainītis faili ar 86 papildinājumiem un 126 dzēšanām
  1. +1
    -0
      changelog.d/9772.misc
  2. +1
    -2
      setup.cfg
  3. +1
    -1
      setup.py
  4. +1
    -2
      synmark/suites/logging.py
  5. +1
    -1
      tests/api/test_auth.py
  6. +1
    -1
      tests/app/test_openid_listener.py
  7. +1
    -2
      tests/appservice/test_appservice.py
  8. +1
    -1
      tests/appservice/test_scheduler.py
  9. +1
    -2
      tests/crypto/test_keyring.py
  10. +3
    -3
      tests/events/test_presence_router.py
  11. +1
    -1
      tests/federation/test_complexity.py
  12. +1
    -2
      tests/federation/test_federation_catch_up.py
  13. +1
    -2
      tests/federation/test_federation_sender.py
  14. +1
    -2
      tests/handlers/test_admin.py
  15. +1
    -1
      tests/handlers/test_appservice.py
  16. +1
    -1
      tests/handlers/test_auth.py
  17. +1
    -1
      tests/handlers/test_cas.py
  18. +1
    -1
      tests/handlers/test_directory.py
  19. +1
    -1
      tests/handlers/test_e2e_keys.py
  20. +1
    -2
      tests/handlers/test_e2e_room_keys.py
  21. +1
    -2
      tests/handlers/test_oidc.py
  22. +1
    -2
      tests/handlers/test_password_providers.py
  23. +1
    -1
      tests/handlers/test_presence.py
  24. +1
    -1
      tests/handlers/test_profile.py
  25. +1
    -1
      tests/handlers/test_register.py
  26. +1
    -2
      tests/handlers/test_saml.py
  27. +1
    -2
      tests/handlers/test_typing.py
  28. +1
    -1
      tests/handlers/test_user_directory.py
  29. +1
    -2
      tests/http/federation/test_matrix_federation_agent.py
  30. +1
    -1
      tests/http/federation/test_srv_resolver.py
  31. +1
    -2
      tests/http/test_client.py
  32. +1
    -1
      tests/http/test_fedclient.py
  33. +1
    -2
      tests/http/test_servlet.py
  34. +1
    -1
      tests/http/test_simple_client.py
  35. +1
    -2
      tests/logging/test_terse_json.py
  36. +3
    -2
      tests/module_api/test_api.py
  37. +1
    -1
      tests/push/test_http.py
  38. +1
    -1
      tests/replication/slave/storage/_base.py
  39. +1
    -1
      tests/replication/tcp/streams/test_receipts.py
  40. +1
    -1
      tests/replication/tcp/streams/test_typing.py
  41. +1
    -1
      tests/replication/test_federation_ack.py
  42. +1
    -2
      tests/replication/test_federation_sender_shard.py
  43. +1
    -2
      tests/replication/test_pusher_shard.py
  44. +1
    -2
      tests/replication/test_sharded_event_persister.py
  45. +1
    -2
      tests/rest/admin/test_admin.py
  46. +1
    -2
      tests/rest/admin/test_room.py
  47. +1
    -2
      tests/rest/admin/test_user.py
  48. +1
    -1
      tests/rest/client/test_retention.py
  49. +1
    -1
      tests/rest/client/test_shadow_banned.py
  50. +1
    -2
      tests/rest/client/test_third_party_rules.py
  51. +1
    -1
      tests/rest/client/test_transactions.py
  52. +1
    -1
      tests/rest/client/v1/test_events.py
  53. +1
    -2
      tests/rest/client/v1/test_login.py
  54. +1
    -1
      tests/rest/client/v1/test_presence.py
  55. +1
    -2
      tests/rest/client/v1/test_rooms.py
  56. +1
    -1
      tests/rest/client/v1/test_typing.py
  57. +1
    -2
      tests/rest/client/v1/utils.py
  58. +1
    -2
      tests/rest/key/v2/test_remote_key_resource.py
  59. +1
    -2
      tests/rest/media/v1/test_media_storage.py
  60. +1
    -2
      tests/rest/media/v1/test_url_preview.py
  61. +1
    -1
      tests/scripts/test_new_matrix_user.py
  62. +1
    -1
      tests/server_notices/test_resource_limits_server_notices.py
  63. +1
    -2
      tests/storage/test_appservice.py
  64. +1
    -1
      tests/storage/test_background_update.py
  65. +1
    -2
      tests/storage/test_base.py
  66. +1
    -3
      tests/storage/test_cleanup_extrems.py
  67. +1
    -1
      tests/storage/test_client_ips.py
  68. +1
    -1
      tests/storage/test_event_push_actions.py
  69. +1
    -1
      tests/storage/test_monthly_active_users.py
  70. +1
    -1
      tests/test_distributor.py
  71. +1
    -1
      tests/test_federation.py
  72. +1
    -2
      tests/test_phone_home.py
  73. +1
    -2
      tests/test_state.py
  74. +1
    -2
      tests/test_terms_auth.py
  75. +1
    -2
      tests/test_utils/__init__.py
  76. +1
    -2
      tests/test_visibility.py
  77. +1
    -2
      tests/unittest.py
  78. +1
    -2
      tests/util/caches/test_descriptors.py
  79. +1
    -1
      tests/util/caches/test_ttlcache.py
  80. +1
    -2
      tests/util/test_file_consumer.py
  81. +1
    -1
      tests/util/test_lrucache.py
  82. +1
    -2
      tests/utils.py

+ 1
- 0
changelog.d/9772.misc Parādīt failu

@@ -0,0 +1 @@
Use mock from the standard library instead of a separate package.

+ 1
- 2
setup.cfg Parādīt failu

@@ -23,11 +23,10 @@ ignore=W503,W504,E203,E731,E501,B007

[isort]
line_length = 88
sections=FUTURE,STDLIB,COMPAT,THIRDPARTY,TWISTED,FIRSTPARTY,TESTS,LOCALFOLDER
sections=FUTURE,STDLIB,THIRDPARTY,TWISTED,FIRSTPARTY,TESTS,LOCALFOLDER
default_section=THIRDPARTY
known_first_party = synapse
known_tests=tests
known_compat = mock
known_twisted=twisted,OpenSSL
multi_line_output=3
include_trailing_comma=true


+ 1
- 1
setup.py Parādīt failu

@@ -110,7 +110,7 @@ CONDITIONAL_REQUIREMENTS["mypy"] = ["mypy==0.812", "mypy-zope==0.2.13"]
# Tests assume that all optional dependencies are installed.
#
# parameterized_class decorator was introduced in parameterized 0.7.0
CONDITIONAL_REQUIREMENTS["test"] = ["mock>=2.0", "parameterized>=0.7.0"]
CONDITIONAL_REQUIREMENTS["test"] = ["parameterized>=0.7.0"]

setup(
name="matrix-synapse",


+ 1
- 2
synmark/suites/logging.py Parādīt failu

@@ -16,8 +16,7 @@
import logging
import warnings
from io import StringIO

from mock import Mock
from unittest.mock import Mock

from pyperf import perf_counter



+ 1
- 1
tests/api/test_auth.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

import pymacaroons



+ 1
- 1
tests/app/test_openid_listener.py Parādīt failu

@@ -12,7 +12,7 @@
# 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.
from mock import Mock, patch
from unittest.mock import Mock, patch

from parameterized import parameterized



+ 1
- 2
tests/appservice/test_appservice.py Parādīt failu

@@ -13,8 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import re

from mock import Mock
from unittest.mock import Mock

from twisted.internet import defer



+ 1
- 1
tests/appservice/test_scheduler.py Parādīt failu

@@ -12,7 +12,7 @@
# 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.
from mock import Mock
from unittest.mock import Mock

from twisted.internet import defer



+ 1
- 2
tests/crypto/test_keyring.py Parādīt failu

@@ -13,8 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import time

from mock import Mock
from unittest.mock import Mock

import attr
import canonicaljson


+ 3
- 3
tests/events/test_presence_router.py Parādīt failu

@@ -13,8 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Dict, Iterable, List, Optional, Set, Tuple, Union

from mock import Mock
from unittest.mock import Mock

import attr

@@ -314,7 +313,8 @@ class PresenceRouterTestCase(FederatingHomeserverTestCase):
self.hs.get_federation_transport_client().send_transaction.call_args_list
)
for call in calls:
federation_transaction = call.args[0] # type: Transaction
call_args = call[0]
federation_transaction = call_args[0] # type: Transaction

# Get the sent EDUs in this transaction
edus = federation_transaction.get_dict()["edus"]


+ 1
- 1
tests/federation/test_complexity.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

from synapse.api.errors import Codes, SynapseError
from synapse.rest import admin


+ 1
- 2
tests/federation/test_federation_catch_up.py Parādīt failu

@@ -1,6 +1,5 @@
from typing import List, Tuple

from mock import Mock
from unittest.mock import Mock

from synapse.api.constants import EventTypes
from synapse.events import EventBase


+ 1
- 2
tests/federation/test_federation_sender.py Parādīt failu

@@ -13,8 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import Optional

from mock import Mock
from unittest.mock import Mock

from signedjson import key, sign
from signedjson.types import BaseKey, SigningKey


+ 1
- 2
tests/handlers/test_admin.py Parādīt failu

@@ -14,8 +14,7 @@
# limitations under the License.

from collections import Counter

from mock import Mock
from unittest.mock import Mock

import synapse.api.errors
import synapse.handlers.admin


+ 1
- 1
tests/handlers/test_appservice.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

from twisted.internet import defer



+ 1
- 1
tests/handlers/test_auth.py Parādīt failu

@@ -12,7 +12,7 @@
# 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.
from mock import Mock
from unittest.mock import Mock

import pymacaroons



+ 1
- 1
tests/handlers/test_cas.py Parādīt failu

@@ -11,7 +11,7 @@
# 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.
from mock import Mock
from unittest.mock import Mock

from synapse.handlers.cas_handler import CasResponse



+ 1
- 1
tests/handlers/test_directory.py Parādīt failu

@@ -14,7 +14,7 @@
# limitations under the License.


from mock import Mock
from unittest.mock import Mock

import synapse
import synapse.api.errors


+ 1
- 1
tests/handlers/test_e2e_keys.py Parādīt failu

@@ -14,7 +14,7 @@
# 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.
import mock
from unittest import mock

from signedjson import key as key, sign as sign



+ 1
- 2
tests/handlers/test_e2e_room_keys.py Parādīt failu

@@ -16,8 +16,7 @@
# limitations under the License.

import copy

import mock
from unittest import mock

from synapse.api.errors import SynapseError



+ 1
- 2
tests/handlers/test_oidc.py Parādīt failu

@@ -14,10 +14,9 @@
# limitations under the License.
import json
import os
from unittest.mock import ANY, Mock, patch
from urllib.parse import parse_qs, urlparse

from mock import ANY, Mock, patch

import pymacaroons

from synapse.handlers.sso import MappingException


+ 1
- 2
tests/handlers/test_password_providers.py Parādīt failu

@@ -16,8 +16,7 @@
"""Tests for the password_auth_provider interface"""

from typing import Any, Type, Union

from mock import Mock
from unittest.mock import Mock

from twisted.internet import defer



+ 1
- 1
tests/handlers/test_presence.py Parādīt failu

@@ -14,7 +14,7 @@
# limitations under the License.


from mock import Mock, call
from unittest.mock import Mock, call

from signedjson.key import generate_signing_key



+ 1
- 1
tests/handlers/test_profile.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

import synapse.types
from synapse.api.errors import AuthError, SynapseError


+ 1
- 1
tests/handlers/test_register.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

from synapse.api.auth import Auth
from synapse.api.constants import UserTypes


+ 1
- 2
tests/handlers/test_saml.py Parādīt failu

@@ -13,8 +13,7 @@
# limitations under the License.

from typing import Optional

from mock import Mock
from unittest.mock import Mock

import attr



+ 1
- 2
tests/handlers/test_typing.py Parādīt failu

@@ -16,8 +16,7 @@

import json
from typing import Dict

from mock import ANY, Mock, call
from unittest.mock import ANY, Mock, call

from twisted.internet import defer
from twisted.web.resource import Resource


+ 1
- 1
tests/handlers/test_user_directory.py Parādīt failu

@@ -12,7 +12,7 @@
# 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.
from mock import Mock
from unittest.mock import Mock

from twisted.internet import defer



+ 1
- 2
tests/http/federation/test_matrix_federation_agent.py Parādīt failu

@@ -14,8 +14,7 @@
# limitations under the License.
import logging
from typing import Optional

from mock import Mock
from unittest.mock import Mock

import treq
from netaddr import IPSet


+ 1
- 1
tests/http/federation/test_srv_resolver.py Parādīt failu

@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

from twisted.internet import defer
from twisted.internet.defer import Deferred


+ 1
- 2
tests/http/test_client.py Parādīt failu

@@ -13,8 +13,7 @@
# limitations under the License.

from io import BytesIO

from mock import Mock
from unittest.mock import Mock

from netaddr import IPSet



+ 1
- 1
tests/http/test_fedclient.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

from netaddr import IPSet
from parameterized import parameterized


+ 1
- 2
tests/http/test_servlet.py Parādīt failu

@@ -14,8 +14,7 @@
# limitations under the License.
import json
from io import BytesIO

from mock import Mock
from unittest.mock import Mock

from synapse.api.errors import SynapseError
from synapse.http.servlet import (


+ 1
- 1
tests/http/test_simple_client.py Parādīt failu

@@ -12,7 +12,7 @@
# 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.
from mock import Mock
from unittest.mock import Mock

from netaddr import IPSet



+ 1
- 2
tests/logging/test_terse_json.py Parādīt failu

@@ -15,8 +15,7 @@
import json
import logging
from io import BytesIO, StringIO

from mock import Mock, patch
from unittest.mock import Mock, patch

from twisted.web.server import Request



+ 3
- 2
tests/module_api/test_api.py Parādīt failu

@@ -12,7 +12,7 @@
# 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.
from mock import Mock
from unittest.mock import Mock

from synapse.api.constants import EduTypes
from synapse.events import EventBase
@@ -358,7 +358,8 @@ class ModuleApiTestCase(FederatingHomeserverTestCase):
self.hs.get_federation_transport_client().send_transaction.call_args_list
)
for call in calls:
federation_transaction = call.args[0] # type: Transaction
call_args = call[0]
federation_transaction = call_args[0] # type: Transaction

# Get the sent EDUs in this transaction
edus = federation_transaction.get_dict()["edus"]


+ 1
- 1
tests/push/test_http.py Parādīt failu

@@ -12,7 +12,7 @@
# 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.
from mock import Mock
from unittest.mock import Mock

from twisted.internet.defer import Deferred



+ 1
- 1
tests/replication/slave/storage/_base.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

from tests.replication._base import BaseStreamTestCase



+ 1
- 1
tests/replication/tcp/streams/test_receipts.py Parādīt failu

@@ -15,7 +15,7 @@

# type: ignore

from mock import Mock
from unittest.mock import Mock

from synapse.replication.tcp.streams._base import ReceiptsStream



+ 1
- 1
tests/replication/tcp/streams/test_typing.py Parādīt failu

@@ -12,7 +12,7 @@
# 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.
from mock import Mock
from unittest.mock import Mock

from synapse.handlers.typing import RoomMember
from synapse.replication.tcp.streams import TypingStream


+ 1
- 1
tests/replication/test_federation_ack.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import mock
from unittest import mock

from synapse.app.generic_worker import GenericWorkerServer
from synapse.replication.tcp.commands import FederationAckCommand


+ 1
- 2
tests/replication/test_federation_sender_shard.py Parādīt failu

@@ -13,8 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging

from mock import Mock
from unittest.mock import Mock

from synapse.api.constants import EventTypes, Membership
from synapse.events.builder import EventBuilderFactory


+ 1
- 2
tests/replication/test_pusher_shard.py Parādīt failu

@@ -13,8 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging

from mock import Mock
from unittest.mock import Mock

from twisted.internet import defer



+ 1
- 2
tests/replication/test_sharded_event_persister.py Parādīt failu

@@ -13,8 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import logging

from mock import patch
from unittest.mock import patch

from synapse.api.room_versions import RoomVersion
from synapse.rest import admin


+ 1
- 2
tests/rest/admin/test_admin.py Parādīt failu

@@ -17,8 +17,7 @@ import json
import os
import urllib.parse
from binascii import unhexlify

from mock import Mock
from unittest.mock import Mock

from twisted.internet.defer import Deferred



+ 1
- 2
tests/rest/admin/test_room.py Parādīt failu

@@ -16,8 +16,7 @@
import json
import urllib.parse
from typing import List, Optional

from mock import Mock
from unittest.mock import Mock

import synapse.rest.admin
from synapse.api.constants import EventTypes, Membership


+ 1
- 2
tests/rest/admin/test_user.py Parādīt failu

@@ -19,8 +19,7 @@ import json
import urllib.parse
from binascii import unhexlify
from typing import List, Optional

from mock import Mock
from unittest.mock import Mock

import synapse.rest.admin
from synapse.api.constants import UserTypes


+ 1
- 1
tests/rest/client/test_retention.py Parādīt failu

@@ -12,7 +12,7 @@
# 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.
from mock import Mock
from unittest.mock import Mock

from synapse.api.constants import EventTypes
from synapse.rest import admin


+ 1
- 1
tests/rest/client/test_shadow_banned.py Parādīt failu

@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock, patch
from unittest.mock import Mock, patch

import synapse.rest.admin
from synapse.api.constants import EventTypes


+ 1
- 2
tests/rest/client/test_third_party_rules.py Parādīt failu

@@ -14,8 +14,7 @@
# limitations under the License.
import threading
from typing import Dict

from mock import Mock
from unittest.mock import Mock

from synapse.events import EventBase
from synapse.module_api import ModuleApi


+ 1
- 1
tests/rest/client/test_transactions.py Parādīt failu

@@ -1,4 +1,4 @@
from mock import Mock, call
from unittest.mock import Mock, call

from twisted.internet import defer, reactor



+ 1
- 1
tests/rest/client/v1/test_events.py Parādīt failu

@@ -15,7 +15,7 @@

""" Tests REST events for /events paths."""

from mock import Mock
from unittest.mock import Mock

import synapse.rest.admin
from synapse.rest.client.v1 import events, login, room


+ 1
- 2
tests/rest/client/v1/test_login.py Parādīt failu

@@ -16,10 +16,9 @@
import time
import urllib.parse
from typing import Any, Dict, List, Optional, Union
from unittest.mock import Mock
from urllib.parse import urlencode

from mock import Mock

import pymacaroons

from twisted.web.resource import Resource


+ 1
- 1
tests/rest/client/v1/test_presence.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

from twisted.internet import defer



+ 1
- 2
tests/rest/client/v1/test_rooms.py Parādīt failu

@@ -20,10 +20,9 @@

import json
from typing import Iterable
from unittest.mock import Mock
from urllib import parse as urlparse

from mock import Mock

import synapse.rest.admin
from synapse.api.constants import EventContentFields, EventTypes, Membership
from synapse.handlers.pagination import PurgeStatus


+ 1
- 1
tests/rest/client/v1/test_typing.py Parādīt failu

@@ -16,7 +16,7 @@

"""Tests REST events for /rooms paths."""

from mock import Mock
from unittest.mock import Mock

from synapse.rest.client.v1 import room
from synapse.types import UserID


+ 1
- 2
tests/rest/client/v1/utils.py Parādīt failu

@@ -21,8 +21,7 @@ import re
import time
import urllib.parse
from typing import Any, Dict, Mapping, MutableMapping, Optional

from mock import patch
from unittest.mock import patch

import attr



+ 1
- 2
tests/rest/key/v2/test_remote_key_resource.py Parādīt failu

@@ -14,8 +14,7 @@
# limitations under the License.
import urllib.parse
from io import BytesIO, StringIO

from mock import Mock
from unittest.mock import Mock

import signedjson.key
from canonicaljson import encode_canonical_json


+ 1
- 2
tests/rest/media/v1/test_media_storage.py Parādīt failu

@@ -18,10 +18,9 @@ import tempfile
from binascii import unhexlify
from io import BytesIO
from typing import Optional
from unittest.mock import Mock
from urllib import parse

from mock import Mock

import attr
from parameterized import parameterized_class
from PIL import Image as Image


+ 1
- 2
tests/rest/media/v1/test_url_preview.py Parādīt failu

@@ -15,8 +15,7 @@
import json
import os
import re

from mock import patch
from unittest.mock import patch

from twisted.internet._resolver import HostResolution
from twisted.internet.address import IPv4Address, IPv6Address


+ 1
- 1
tests/scripts/test_new_matrix_user.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

from synapse._scripts.register_new_matrix_user import request_registration



+ 1
- 1
tests/server_notices/test_resource_limits_server_notices.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

from twisted.internet import defer



+ 1
- 2
tests/storage/test_appservice.py Parādīt failu

@@ -15,8 +15,7 @@
import json
import os
import tempfile

from mock import Mock
from unittest.mock import Mock

import yaml



+ 1
- 1
tests/storage/test_background_update.py Parādīt failu

@@ -1,4 +1,4 @@
from mock import Mock
from unittest.mock import Mock

from synapse.storage.background_updates import BackgroundUpdater



+ 1
- 2
tests/storage/test_base.py Parādīt failu

@@ -15,8 +15,7 @@


from collections import OrderedDict

from mock import Mock
from unittest.mock import Mock

from twisted.internet import defer



+ 1
- 3
tests/storage/test_cleanup_extrems.py Parādīt failu

@@ -14,9 +14,7 @@
# limitations under the License.

import os.path
from unittest.mock import patch

from mock import Mock
from unittest.mock import Mock, patch

import synapse.rest.admin
from synapse.api.constants import EventTypes


+ 1
- 1
tests/storage/test_client_ips.py Parādīt failu

@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

import synapse.rest.admin
from synapse.http.site import XForwardedForRequest


+ 1
- 1
tests/storage/test_event_push_actions.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

from tests.unittest import HomeserverTestCase



+ 1
- 1
tests/storage/test_monthly_active_users.py Parādīt failu

@@ -12,7 +12,7 @@
# 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.
from mock import Mock
from unittest.mock import Mock

from twisted.internet import defer



+ 1
- 1
tests/test_distributor.py Parādīt failu

@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock, patch
from unittest.mock import Mock, patch

from synapse.util.distributor import Distributor



+ 1
- 1
tests/test_federation.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

from twisted.internet.defer import succeed



+ 1
- 2
tests/test_phone_home.py Parādīt failu

@@ -14,8 +14,7 @@
# limitations under the License.

import resource

import mock
from unittest import mock

from synapse.app.phone_stats_home import phone_stats_home



+ 1
- 2
tests/test_state.py Parādīt failu

@@ -13,8 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import List, Optional

from mock import Mock
from unittest.mock import Mock

from twisted.internet import defer



+ 1
- 2
tests/test_terms_auth.py Parādīt failu

@@ -13,8 +13,7 @@
# limitations under the License.

import json

from mock import Mock
from unittest.mock import Mock

from twisted.test.proto_helpers import MemoryReactorClock



+ 1
- 2
tests/test_utils/__init__.py Parādīt failu

@@ -21,8 +21,7 @@ import sys
import warnings
from asyncio import Future
from typing import Any, Awaitable, Callable, TypeVar

from mock import Mock
from unittest.mock import Mock

import attr



+ 1
- 2
tests/test_visibility.py Parādīt failu

@@ -14,8 +14,7 @@
# limitations under the License.
import logging
from typing import Optional

from mock import Mock
from unittest.mock import Mock

from twisted.internet import defer
from twisted.internet.defer import succeed


+ 1
- 2
tests/unittest.py Parādīt failu

@@ -21,8 +21,7 @@ import inspect
import logging
import time
from typing import Callable, Dict, Iterable, Optional, Tuple, Type, TypeVar, Union

from mock import Mock, patch
from unittest.mock import Mock, patch

from canonicaljson import json



+ 1
- 2
tests/util/caches/test_descriptors.py Parādīt failu

@@ -15,8 +15,7 @@
# limitations under the License.
import logging
from typing import Set

import mock
from unittest import mock

from twisted.internet import defer, reactor



+ 1
- 1
tests/util/caches/test_ttlcache.py Parādīt failu

@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from mock import Mock
from unittest.mock import Mock

from synapse.util.caches.ttlcache import TTLCache



+ 1
- 2
tests/util/test_file_consumer.py Parādīt failu

@@ -16,8 +16,7 @@

import threading
from io import StringIO

from mock import NonCallableMock
from unittest.mock import NonCallableMock

from twisted.internet import defer, reactor



+ 1
- 1
tests/util/test_lrucache.py Parādīt failu

@@ -14,7 +14,7 @@
# limitations under the License.


from mock import Mock
from unittest.mock import Mock

from synapse.util.caches.lrucache import LruCache
from synapse.util.caches.treecache import TreeCache


+ 1
- 2
tests/utils.py Parādīt failu

@@ -21,10 +21,9 @@ import time
import uuid
import warnings
from typing import Type
from unittest.mock import Mock, patch
from urllib import parse as urlparse

from mock import Mock, patch

from twisted.internet import defer

from synapse.api.constants import EventTypes


Notiek ielāde…
Atcelt
Saglabāt