Esempio n. 1
0
def setup_inject(peewee_database_storage):
    inject.clear_and_configure(
        lambda binder: binder.bind(SqliteDatabase, peewee_database_storage).
        bind_to_constructor("FilesystemMonitor", MagicMock()
                            ).bind_to_constructor(Library, MagicMock()))

    yield
    inject.clear()
Esempio n. 2
0
def setup_inject(peewee_database):
    inject.clear()
    inject.configure(lambda binder:
                     (binder.bind(SqliteDatabase, peewee_database),
                      binder.bind_to_constructor(Settings, lambda: Settings()).
                      bind_to_constructor(ApplicationSettings, lambda:
                                          ApplicationSettingsMock())))
    yield
    inject.clear()
Esempio n. 3
0
def setup_inject(peewee_database):
    inject.clear_and_configure(
        lambda binder: binder.bind(SqliteDatabase, peewee_database).
        bind_to_constructor("FilesystemMonitor", MagicMock(
        )).bind_to_constructor(GstPlayer, MagicMock()).bind_to_constructor(
            ApplicationSettings, MagicMock()).bind_to_constructor(
                Library, lambda: Library()).bind_to_constructor(
                    Settings, lambda: Settings()))

    yield
    inject.clear()
Esempio n. 4
0
def setup_inject(peewee_database_storage):
    inject.clear_and_configure(
        lambda binder: binder.bind(SqliteDatabase, peewee_database_storage))
    yield
    inject.clear()
Esempio n. 5
0
def setup_inject(peewee_database):
    inject.clear()
    inject.configure(lambda binder:
                     (binder.bind(SqliteDatabase, peewee_database)))
    yield
    inject.clear()