mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-12-02 20:59:56 -05:00
Fixing download config import issue.
This commit is contained in:
parent
630d06980a
commit
10d34d7390
3 changed files with 5 additions and 5 deletions
|
|
@ -376,7 +376,7 @@ async def test_zim_subscription_download_import(async_client, test_session):
|
|||
|
||||
for _ in range(1): # Import twice.
|
||||
# Importing the config restores the Download and ZimSubscription.
|
||||
await import_downloads_config(test_session)
|
||||
await import_downloads_config()
|
||||
recurring, once = test_session.query(Download).order_by(Download.frequency)
|
||||
assert once.url == 'https://download.kiwix.org/zim/wikibooks/wikibooks_en_all_maxi_2021-03.zim'
|
||||
assert test_session.query(Download).count() == 2
|
||||
|
|
|
|||
|
|
@ -1436,7 +1436,7 @@ def save_downloads_config():
|
|||
save_downloads_config: ActivateSwitchMethod
|
||||
|
||||
|
||||
async def import_downloads_config(session: Session):
|
||||
async def import_downloads_config():
|
||||
"""Upsert all Downloads in the Download Manager Config into the DB.
|
||||
|
||||
The config is the source of truth."""
|
||||
|
|
|
|||
|
|
@ -415,7 +415,7 @@ async def test_crud_download(async_client, test_session, test_download_manager,
|
|||
async def test_downloads_config(test_session, test_download_manager, test_download_manager_config,
|
||||
test_downloader, assert_downloads, tag_factory, await_switches):
|
||||
# Can import with an empty config.
|
||||
await import_downloads_config(test_session)
|
||||
await import_downloads_config()
|
||||
assert_downloads([])
|
||||
|
||||
test_downloader.set_test_success()
|
||||
|
|
@ -479,7 +479,7 @@ async def test_downloads_config(test_session, test_download_manager, test_downlo
|
|||
get_download_manager_config().initialize()
|
||||
|
||||
# Import the saved downloads.
|
||||
await import_downloads_config(test_session)
|
||||
await import_downloads_config()
|
||||
expected = [
|
||||
dict(
|
||||
url='https://example.com/2',
|
||||
|
|
@ -504,7 +504,7 @@ async def test_downloads_config(test_session, test_download_manager, test_downlo
|
|||
assert_downloads(expected)
|
||||
|
||||
# Import again, no duplicates.
|
||||
await import_downloads_config(test_session)
|
||||
await import_downloads_config()
|
||||
assert_downloads(expected)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue