Add function to calculate all existing file hashes if wanted

This commit is contained in:
Serene-Arc
2021-03-11 14:18:48 +10:00
committed by Ali Parlakci
parent f941161014
commit 6d6327a396
4 changed files with 24 additions and 1 deletions

View File

@@ -407,3 +407,10 @@ def test_download_submission_hash_exists(
def test_sanitise_subreddit_name(test_name: str, expected: str):
result = RedditDownloader._sanitise_subreddit_name(test_name)
assert result == expected
def test_search_existing_files(downloader_mock: MagicMock):
downloader_mock.download_directory = Path('.').resolve().expanduser()
results = RedditDownloader.scan_existing_files(downloader_mock)
assert all([isinstance(result, str) for result in results])
assert len(results) >= 40