mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-13 22:43:50 +01:00
Fix tests after commit 9a0579
This commit is contained in:
parent
279a547a8b
commit
22d7a59306
1 changed files with 6 additions and 0 deletions
|
@ -33,12 +33,18 @@ class SQLBaseStoreTestCase(unittest.TestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.db_pool = Mock(spec=["runInteraction"])
|
self.db_pool = Mock(spec=["runInteraction"])
|
||||||
self.mock_txn = Mock()
|
self.mock_txn = Mock()
|
||||||
|
self.mock_conn = Mock(spec_set=["cursor"])
|
||||||
|
self.mock_conn.cursor.return_value = self.mock_txn
|
||||||
# Our fake runInteraction just runs synchronously inline
|
# Our fake runInteraction just runs synchronously inline
|
||||||
|
|
||||||
def runInteraction(func, *args, **kwargs):
|
def runInteraction(func, *args, **kwargs):
|
||||||
return defer.succeed(func(self.mock_txn, *args, **kwargs))
|
return defer.succeed(func(self.mock_txn, *args, **kwargs))
|
||||||
self.db_pool.runInteraction = runInteraction
|
self.db_pool.runInteraction = runInteraction
|
||||||
|
|
||||||
|
def runWithConnection(func, *args, **kwargs):
|
||||||
|
return defer.succeed(func(self.mock_conn, *args, **kwargs))
|
||||||
|
self.db_pool.runWithConnection = runWithConnection
|
||||||
|
|
||||||
config = Mock()
|
config = Mock()
|
||||||
config.event_cache_size = 1
|
config.event_cache_size = 1
|
||||||
hs = HomeServer(
|
hs = HomeServer(
|
||||||
|
|
Loading…
Reference in a new issue