mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 14:14:56 -04:00
Add database config class (#6513)
This encapsulates config for a given database and is the way to get new connections.
This commit is contained in:
parent
91ccfe9f37
commit
2284eb3a53
19 changed files with 286 additions and 208 deletions
|
@ -64,28 +64,29 @@ class TypingNotificationsTestCase(unittest.HomeserverTestCase):
|
|||
mock_federation_client = Mock(spec=["put_json"])
|
||||
mock_federation_client.put_json.return_value = defer.succeed((200, "OK"))
|
||||
|
||||
hs = self.setup_test_homeserver(
|
||||
datastore=(
|
||||
Mock(
|
||||
spec=[
|
||||
# Bits that Federation needs
|
||||
"prep_send_transaction",
|
||||
"delivered_txn",
|
||||
"get_received_txn_response",
|
||||
"set_received_txn_response",
|
||||
"get_destination_retry_timings",
|
||||
"get_device_updates_by_remote",
|
||||
# Bits that user_directory needs
|
||||
"get_user_directory_stream_pos",
|
||||
"get_current_state_deltas",
|
||||
]
|
||||
)
|
||||
),
|
||||
notifier=Mock(),
|
||||
http_client=mock_federation_client,
|
||||
keyring=mock_keyring,
|
||||
datastores = Mock()
|
||||
datastores.main = Mock(
|
||||
spec=[
|
||||
# Bits that Federation needs
|
||||
"prep_send_transaction",
|
||||
"delivered_txn",
|
||||
"get_received_txn_response",
|
||||
"set_received_txn_response",
|
||||
"get_destination_retry_timings",
|
||||
"get_devices_by_remote",
|
||||
# Bits that user_directory needs
|
||||
"get_user_directory_stream_pos",
|
||||
"get_current_state_deltas",
|
||||
"get_device_updates_by_remote",
|
||||
]
|
||||
)
|
||||
|
||||
hs = self.setup_test_homeserver(
|
||||
notifier=Mock(), http_client=mock_federation_client, keyring=mock_keyring
|
||||
)
|
||||
|
||||
hs.datastores = datastores
|
||||
|
||||
return hs
|
||||
|
||||
def prepare(self, reactor, clock, hs):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue