def provide_di(reset_di):  # noqa
    injector.register_as_singleton(Database, MagicMock)
    injector.register_as_singleton(OccLocker, lambda: MagicMock(unsafe=True))
    injector.register_as_singleton(EventTranslator, MagicMock)
    injector.register_as_singleton(EventExecutor, MagicMock)
    injector.register_as_singleton(Messaging, MagicMock)
    injector.register(Writer, WriterService)
    injector.register(EnvironmentService, EnvironmentService)
    yield
Esempio n. 2
0
def setup_di(reset_di):  # noqa
    injector.register_as_singleton(ConnectionHandler, FakeConnectionHandler)
    injector.register_as_singleton(ReadDatabase, MagicMock)
    injector.register(Database, SqlDatabaseBackendService)
    injector.register_as_singleton(OccLocker, MagicMock)
    injector.register_as_singleton(Messaging, MagicMock)
    injector.register(EnvironmentService, EnvironmentService)
    core_setup_di()
def provide_di(reset_di):  # noqa
    injector.register_as_singleton(Reader, MagicMock)
def setup_di(reset_di):  # noqa
    injector.register_as_singleton(OccLocker, MagicMock)
    injector.register_as_singleton(Database, MagicMock)
    injector.register_as_singleton(ReadDatabase, MagicMock)
    injector.register_as_singleton(Messaging, MagicMock)
    core_setup_di()
def event_translator(reset_di):  # noqa
    injector.register_as_singleton(ReadDatabase, MagicMock)
    injector.register(EventTranslator, EventTranslatorService)
    yield injector.get(EventTranslator)
def provide_di(reset_di):  # noqa
    injector.register_as_singleton(ConnectionHandler, MagicMock)
    injector.register_as_singleton(ReadDatabase, MagicMock)
    injector.register(Reader, ReaderService)
    injector.register(EnvironmentService, EnvironmentService)
    yield
Esempio n. 7
0
def provide_di(reset_di):  # noqa
    injector.register_as_singleton(ReadDatabase, MagicMock)
    injector.register(EventExecutor, EventExecutorService)
    yield
def provide_di(reset_di):  # noqa
    injector.register_as_singleton(ConnectionHandler, MagicMock)
    injector.register_as_singleton(ReadDatabase, MagicMock)
    injector.register(Database, SqlDatabaseBackendService)
    yield
def setup_di(reset_di):  # noqa
    injector.register_as_singleton(ConnectionHandler, FakeConnectionHandler)
    injector.register_as_singleton(SqlQueryHelper, SqlQueryHelper)
    injector.register_as_singleton(ReadDatabase, SqlReadDatabaseBackendService)
    injector.register_as_singleton(Reader, ReaderService)
    injector.register(EnvironmentService, EnvironmentService)
Esempio n. 10
0
def provide_di(reset_di):  # noqa
    injector.register_as_singleton(ConnectionHandler, MagicMock)
    injector.register(SqlQueryHelper, SqlQueryHelper)
    injector.register(ReadDatabase, SqlReadDatabaseBackendService)
    injector.register(OccLocker, SqlOccLockerBackendService)
    yield
def writer(reset_di):  # noqa
    injector.register_as_singleton(Writer, MagicMock)
    yield injector.get(Writer)