mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-10-08 09:38:24 -04:00
Pass around the reactor explicitly (#3385)
This commit is contained in:
parent
c2eff937ac
commit
77ac14b960
25 changed files with 141 additions and 93 deletions
|
@ -1,9 +1,9 @@
|
|||
from synapse.rest.client.transactions import HttpTransactionCache
|
||||
from synapse.rest.client.transactions import CLEANUP_PERIOD_MS
|
||||
from twisted.internet import defer
|
||||
from twisted.internet import defer, reactor
|
||||
from mock import Mock, call
|
||||
|
||||
from synapse.util import async
|
||||
from synapse.util import Clock
|
||||
from synapse.util.logcontext import LoggingContext
|
||||
from tests import unittest
|
||||
from tests.utils import MockClock
|
||||
|
@ -46,7 +46,7 @@ class HttpTransactionCacheTestCase(unittest.TestCase):
|
|||
def test_logcontexts_with_async_result(self):
|
||||
@defer.inlineCallbacks
|
||||
def cb():
|
||||
yield async.sleep(0)
|
||||
yield Clock(reactor).sleep(0)
|
||||
defer.returnValue("yay")
|
||||
|
||||
@defer.inlineCallbacks
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# limitations under the License.
|
||||
|
||||
|
||||
from twisted.internet import defer
|
||||
from twisted.internet import defer, reactor
|
||||
|
||||
from synapse.rest.media.v1._base import FileInfo
|
||||
from synapse.rest.media.v1.media_storage import MediaStorage
|
||||
|
@ -38,6 +38,7 @@ class MediaStorageTests(unittest.TestCase):
|
|||
self.secondary_base_path = os.path.join(self.test_dir, "secondary")
|
||||
|
||||
hs = Mock()
|
||||
hs.get_reactor = Mock(return_value=reactor)
|
||||
hs.config.media_store_path = self.primary_base_path
|
||||
|
||||
storage_providers = [FileStorageProviderBackend(
|
||||
|
@ -46,7 +47,7 @@ class MediaStorageTests(unittest.TestCase):
|
|||
|
||||
self.filepaths = MediaFilePaths(self.primary_base_path)
|
||||
self.media_storage = MediaStorage(
|
||||
self.primary_base_path, self.filepaths, storage_providers,
|
||||
hs, self.primary_base_path, self.filepaths, storage_providers,
|
||||
)
|
||||
|
||||
def tearDown(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue