tests: Move simulated_queue_client to the only test it is used in.

This commit is contained in:
Alex Vandiver
2021-11-15 11:53:35 -08:00
committed by Tim Abbott
parent 64268f47e8
commit d1822b5630
2 changed files with 45 additions and 44 deletions

View File

@@ -60,7 +60,6 @@ from zerver.models import (
get_stream,
)
from zerver.tornado.handlers import AsyncDjangoHandler, allocate_handler_id
from zerver.worker import queue_processors
from zilencer.models import RemoteZulipServer
from zproject.backends import ExternalAuthDataDict, ExternalAuthResult
@@ -92,12 +91,6 @@ def stub_event_queue_user_events(
yield
@contextmanager
def simulated_queue_client(client: Callable[[], object]) -> Iterator[None]:
with mock.patch.object(queue_processors, "SimpleQueueClient", client):
yield
@contextmanager
def cache_tries_captured() -> Iterator[List[Tuple[str, Union[str, List[str]], Optional[str]]]]:
cache_queries: List[Tuple[str, Union[str, List[str]], Optional[str]]] = []