Mocking apply_indexers because it is unecessary for this test.

This commit is contained in:
Roland 2022-12-14 13:16:42 -07:00
parent a160f2788b
commit cdc02ecaf2
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
2 changed files with 3 additions and 1 deletions

View file

@ -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'),

View file

@ -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}')