Ejemplo n.º 1
0
async def test_library_cache_trove(create_resolver, get_torchlight_trove):
    trove_raw, trove_game = get_torchlight_trove
    sources = {SOURCE.TROVE}
    cache = {'troves': [trove_raw]}
    library = create_resolver(LibrarySettings(sources), cache)
    assert {
        trove_game.machine_name: trove_game
    } == await library(only_cache=True)
async def test_library_cache_key(create_resolver, get_torchlight):
    order, _, key = get_torchlight
    sources = {SOURCE.KEYS}
    cache = {'orders': {'mock_order_id': order}}
    library = create_resolver(LibrarySettings(sources), cache)
    assert {key.machine_name: key} == await library(only_cache=True)
async def test_library_cache_drm_free(create_resolver, get_torchlight):
    order, game, _ = get_torchlight
    sources = {SOURCE.DRM_FREE}
    cache = {'orders': {'mock_order_id': order}}
    library = create_resolver(LibrarySettings(sources), cache)
    assert {game.machine_name: game} == await library(only_cache=True)
def test_settings_default_config():
    """Default values comes directly from specific settings classes"""
    Settings()._config == {
        'library': LibrarySettings().serialize(),
        'installed': InstalledSettings().serialize()
    }