mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Fix tests
This commit is contained in:
parent
af613824e4
commit
164f6b9256
@ -21,6 +21,8 @@ from synapse.api.auth import Auth
|
|||||||
from synapse.api.constants import EventTypes, Membership
|
from synapse.api.constants import EventTypes, Membership
|
||||||
from synapse.state import StateHandler
|
from synapse.state import StateHandler
|
||||||
|
|
||||||
|
from .utils import MockClock
|
||||||
|
|
||||||
from mock import Mock
|
from mock import Mock
|
||||||
|
|
||||||
|
|
||||||
@ -138,10 +140,13 @@ class StateTestCase(unittest.TestCase):
|
|||||||
"add_event_hashes",
|
"add_event_hashes",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
hs = Mock(spec=["get_datastore", "get_auth", "get_state_handler"])
|
hs = Mock(spec=[
|
||||||
|
"get_datastore", "get_auth", "get_state_handler", "get_clock",
|
||||||
|
])
|
||||||
hs.get_datastore.return_value = self.store
|
hs.get_datastore.return_value = self.store
|
||||||
hs.get_state_handler.return_value = None
|
hs.get_state_handler.return_value = None
|
||||||
hs.get_auth.return_value = Auth(hs)
|
hs.get_auth.return_value = Auth(hs)
|
||||||
|
hs.get_clock.return_value = MockClock()
|
||||||
|
|
||||||
self.state = StateHandler(hs)
|
self.state = StateHandler(hs)
|
||||||
self.event_id = 0
|
self.event_id = 0
|
||||||
|
Loading…
Reference in New Issue
Block a user