mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-14 11:57:44 +00:00
Move MockClock into tests.utils so we can reüse it
This commit is contained in:
parent
baf04be5cf
commit
fc778e2bce
2 changed files with 11 additions and 11 deletions
|
@ -20,7 +20,7 @@ from twisted.trial import unittest
|
|||
from mock import Mock
|
||||
import logging
|
||||
|
||||
from ..utils import MockHttpServer
|
||||
from ..utils import MockHttpServer, MockClock
|
||||
|
||||
from synapse.server import HomeServer
|
||||
from synapse.federation import initialize_http_replication
|
||||
|
@ -48,16 +48,6 @@ def make_pdu(prev_pdus=[], **kwargs):
|
|||
return PduTuple(PduEntry(**pdu_fields), prev_pdus)
|
||||
|
||||
|
||||
class MockClock(object):
|
||||
now = 1000
|
||||
|
||||
def time(self):
|
||||
return self.now
|
||||
|
||||
def time_msec(self):
|
||||
return self.time() * 1000
|
||||
|
||||
|
||||
class FederationTestCase(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.mock_http_server = MockHttpServer()
|
||||
|
|
|
@ -95,6 +95,16 @@ class MockHttpServer(HttpServer):
|
|||
self.callbacks.append((method, path_pattern, callback))
|
||||
|
||||
|
||||
class MockClock(object):
|
||||
now = 1000
|
||||
|
||||
def time(self):
|
||||
return self.now
|
||||
|
||||
def time_msec(self):
|
||||
return self.time() * 1000
|
||||
|
||||
|
||||
class MemoryDataStore(object):
|
||||
|
||||
class RoomMember(namedtuple(
|
||||
|
|
Loading…
Reference in a new issue