Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[pytest]
testpaths = tests
python_files = test_*.py
python_classes = Test*
python_functions = test_*
addopts = -v -s --doctest-modules
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file makes the tests directory a Python package
Binary file not shown.
15 changes: 15 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -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'
}
1 change: 1 addition & 0 deletions tests/unit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file makes the unit test directory a Python package
1 change: 1 addition & 0 deletions tests/unit/worker_threads/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This file makes the worker_threads test directory a Python package
Binary file not shown.
Binary file not shown.
Binary file not shown.
22 changes: 22 additions & 0 deletions tests/unit/worker_threads/test_download_worker.py
Original file line number Diff line number Diff line change
@@ -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")
22 changes: 22 additions & 0 deletions tests/unit/worker_threads/test_indexer_worker.py
Original file line number Diff line number Diff line change
@@ -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")
22 changes: 22 additions & 0 deletions tests/unit/worker_threads/test_text_extract_worker.py
Original file line number Diff line number Diff line change
@@ -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")