reformatting
formatting_check / formatting_check (push) Failing after 3s
Python Test / test (.ps1, windows-latest, 3.9) (push) Has been cancelled
Python Test / test (.sh, macos-latest, 3.9) (push) Has been cancelled
Python Test / test (.sh, ubuntu-latest, 3.9) (push) Has been cancelled
formatting_check / formatting_check (push) Failing after 3s
Python Test / test (.ps1, windows-latest, 3.9) (push) Has been cancelled
Python Test / test (.sh, macos-latest, 3.9) (push) Has been cancelled
Python Test / test (.sh, ubuntu-latest, 3.9) (push) Has been cancelled
This commit is contained in:
@@ -4,14 +4,15 @@ Test script to verify that the duplicate folder creation fix works correctly.
|
||||
This script simulates the scenario where duplicate posts would previously create empty folders.
|
||||
"""
|
||||
|
||||
import tempfile
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
# Add the bdfr module to the path
|
||||
import sys
|
||||
sys.path.insert(0, '.')
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
sys.path.insert(0, ".")
|
||||
|
||||
from bdfr.configuration import Configuration
|
||||
from bdfr.connector import RedditConnector
|
||||
@@ -69,6 +70,7 @@ def test_duplicate_folder_creation_fix():
|
||||
|
||||
# Mock the download factory
|
||||
import bdfr.site_downloaders.download_factory as df
|
||||
|
||||
original_pull_lever = df.DownloadFactory.pull_lever
|
||||
df.DownloadFactory.pull_lever = MagicMock(return_value=mock_downloader_class)
|
||||
|
||||
@@ -93,4 +95,4 @@ def test_duplicate_folder_creation_fix():
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_duplicate_folder_creation_fix()
|
||||
print("All tests passed! The duplicate folder creation fix is working correctly.")
|
||||
print("All tests passed! The duplicate folder creation fix is working correctly.")
|
||||
|
||||
Reference in New Issue
Block a user