diff --git a/WorkerThreads/__pycache__/DownloadWorker.cpython-312.pyc b/WorkerThreads/__pycache__/DownloadWorker.cpython-312.pyc new file mode 100644 index 0000000..7651d93 Binary files /dev/null and b/WorkerThreads/__pycache__/DownloadWorker.cpython-312.pyc differ diff --git a/WorkerThreads/__pycache__/IndexerWorker.cpython-312.pyc b/WorkerThreads/__pycache__/IndexerWorker.cpython-312.pyc new file mode 100644 index 0000000..a9b3f44 Binary files /dev/null and b/WorkerThreads/__pycache__/IndexerWorker.cpython-312.pyc differ diff --git a/WorkerThreads/__pycache__/TextExtractWorker.cpython-312.pyc b/WorkerThreads/__pycache__/TextExtractWorker.cpython-312.pyc new file mode 100644 index 0000000..8999b71 Binary files /dev/null and b/WorkerThreads/__pycache__/TextExtractWorker.cpython-312.pyc differ diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 0000000..71ccb2d --- /dev/null +++ b/pytest.ini @@ -0,0 +1,6 @@ +[pytest] +testpaths = tests +python_files = test_*.py +python_classes = Test* +python_functions = test_* +addopts = -v -s --doctest-modules \ No newline at end of file diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..5e1a8a5 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1 @@ +# This file makes the tests directory a Python package \ No newline at end of file diff --git a/tests/__pycache__/conftest.cpython-312-pytest-8.3.5.pyc b/tests/__pycache__/conftest.cpython-312-pytest-8.3.5.pyc new file mode 100644 index 0000000..68d0cb7 Binary files /dev/null and b/tests/__pycache__/conftest.cpython-312-pytest-8.3.5.pyc differ diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..aebdd45 --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,15 @@ +import pytest +import sys +import os + +# Add project root to Python path +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) + +@pytest.fixture +def mock_config(): + """Fixture to provide mock configuration for tests.""" + return { + 'auth_path': '.auth', + 'download_path': 'downloads', + 'index_path': 'index' + } \ No newline at end of file diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py new file mode 100644 index 0000000..81f5145 --- /dev/null +++ b/tests/unit/__init__.py @@ -0,0 +1 @@ +# This file makes the unit test directory a Python package \ No newline at end of file diff --git a/tests/unit/worker_threads/__init__.py b/tests/unit/worker_threads/__init__.py new file mode 100644 index 0000000..0f7ae64 --- /dev/null +++ b/tests/unit/worker_threads/__init__.py @@ -0,0 +1 @@ +# This file makes the worker_threads test directory a Python package \ No newline at end of file diff --git a/tests/unit/worker_threads/__pycache__/test_download_worker.cpython-312-pytest-8.3.5.pyc b/tests/unit/worker_threads/__pycache__/test_download_worker.cpython-312-pytest-8.3.5.pyc new file mode 100644 index 0000000..24414c2 Binary files /dev/null and b/tests/unit/worker_threads/__pycache__/test_download_worker.cpython-312-pytest-8.3.5.pyc differ diff --git a/tests/unit/worker_threads/__pycache__/test_indexer_worker.cpython-312-pytest-8.3.5.pyc b/tests/unit/worker_threads/__pycache__/test_indexer_worker.cpython-312-pytest-8.3.5.pyc new file mode 100644 index 0000000..51f6563 Binary files /dev/null and b/tests/unit/worker_threads/__pycache__/test_indexer_worker.cpython-312-pytest-8.3.5.pyc differ diff --git a/tests/unit/worker_threads/__pycache__/test_text_extract_worker.cpython-312-pytest-8.3.5.pyc b/tests/unit/worker_threads/__pycache__/test_text_extract_worker.cpython-312-pytest-8.3.5.pyc new file mode 100644 index 0000000..5f4ef20 Binary files /dev/null and b/tests/unit/worker_threads/__pycache__/test_text_extract_worker.cpython-312-pytest-8.3.5.pyc differ diff --git a/tests/unit/worker_threads/test_download_worker.py b/tests/unit/worker_threads/test_download_worker.py new file mode 100644 index 0000000..fd340bc --- /dev/null +++ b/tests/unit/worker_threads/test_download_worker.py @@ -0,0 +1,22 @@ +import pytest +import sys +import os + +# Add project root to Python path +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))) + +def test_worker_threads_directory_exists(): + """Verify that the WorkerThreads directory exists.""" + assert os.path.exists('WorkerThreads'), "WorkerThreads directory should exist" + +def test_download_worker_file_exists(): + """Check if DownloadWorker.py file exists.""" + assert os.path.exists('WorkerThreads/DownloadWorker.py'), "DownloadWorker.py should exist" + +def test_download_worker_importable(): + """Test basic importability of DownloadWorker.""" + try: + from WorkerThreads.DownloadWorker import DownloadWorker + assert hasattr(DownloadWorker, '__init__'), "DownloadWorker should have an __init__ method" + except ImportError: + pytest.skip("Unable to import DownloadWorker, possibly due to external dependencies") \ No newline at end of file diff --git a/tests/unit/worker_threads/test_indexer_worker.py b/tests/unit/worker_threads/test_indexer_worker.py new file mode 100644 index 0000000..8d7ac18 --- /dev/null +++ b/tests/unit/worker_threads/test_indexer_worker.py @@ -0,0 +1,22 @@ +import pytest +import sys +import os + +# Add project root to Python path +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))) + +def test_worker_threads_directory_exists(): + """Verify that the WorkerThreads directory exists.""" + assert os.path.exists('WorkerThreads'), "WorkerThreads directory should exist" + +def test_indexer_worker_file_exists(): + """Check if IndexerWorker.py file exists.""" + assert os.path.exists('WorkerThreads/IndexerWorker.py'), "IndexerWorker.py should exist" + +def test_indexer_worker_importable(): + """Test basic importability of IndexerWorker.""" + try: + from WorkerThreads.IndexerWorker import IndexerWorker + assert hasattr(IndexerWorker, '__init__'), "IndexerWorker should have an __init__ method" + except ImportError: + pytest.skip("Unable to import IndexerWorker, possibly due to external dependencies") \ No newline at end of file diff --git a/tests/unit/worker_threads/test_text_extract_worker.py b/tests/unit/worker_threads/test_text_extract_worker.py new file mode 100644 index 0000000..983adad --- /dev/null +++ b/tests/unit/worker_threads/test_text_extract_worker.py @@ -0,0 +1,22 @@ +import pytest +import sys +import os + +# Add project root to Python path +sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))) + +def test_worker_threads_directory_exists(): + """Verify that the WorkerThreads directory exists.""" + assert os.path.exists('WorkerThreads'), "WorkerThreads directory should exist" + +def test_text_extract_worker_file_exists(): + """Check if TextExtractWorker.py file exists.""" + assert os.path.exists('WorkerThreads/TextExtractWorker.py'), "TextExtractWorker.py should exist" + +def test_text_extract_worker_importable(): + """Test basic importability of TextExtractWorker.""" + try: + from WorkerThreads.TextExtractWorker import TextExtractWorker + assert hasattr(TextExtractWorker, '__init__'), "TextExtractWorker should have an __init__ method" + except ImportError: + pytest.skip("Unable to import TextExtractWorker, possibly due to external dependencies") \ No newline at end of file