From cdc02ecaf228215d2cfb81b6cc66bb8d04779285 Mon Sep 17 00:00:00 2001 From: Roland Date: Wed, 14 Dec 2022 13:16:42 -0700 Subject: [PATCH] Mocking apply_indexers because it is unecessary for this test. --- modules/videos/channel/test/test_api.py | 3 ++- wrolpi/files/lib.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/videos/channel/test/test_api.py b/modules/videos/channel/test/test_api.py index 10fe963e..8e022282 100644 --- a/modules/videos/channel/test/test_api.py +++ b/modules/videos/channel/test/test_api.py @@ -280,7 +280,8 @@ async def test_download_channel_no_refresh(test_session, download_channel, video return DownloadResult(success=True) with mock.patch('modules.videos.downloader.YDL.extract_info') as mock_extract_info, \ - mock.patch('modules.videos.downloader.VideoDownloader.do_download', do_download): + mock.patch('modules.videos.downloader.VideoDownloader.do_download', do_download), \ + mock.patch('wrolpi.files.lib.apply_indexers'): # TODO why does apply_indexers break this test? entries = [ dict(id=vid.source_id, view_count=0, webpage_url='https://example.com/1'), # Already downloaded. dict(id='not downloaded', view_count=0, webpage_url='https://example.com/2'), diff --git a/wrolpi/files/lib.py b/wrolpi/files/lib.py index eb72ef83..2ddcc7db 100644 --- a/wrolpi/files/lib.py +++ b/wrolpi/files/lib.py @@ -385,6 +385,7 @@ async def refresh_directory_files_recursively(directory: Union[pathlib.Path, str curs.execute(stmt, params) apply_after_refresh() + await apply_indexers() refresh_logger.info(f'Done refreshing files in {directory}')