feat(setup): T01 create project directory structure

- Create src/openrouter_monitor/ package structure
- Create models/, routers/, services/, utils/ subpackages
- Create tests/unit/ and tests/integration/ structure
- Create alembic/, docs/, scripts/ directories
- Add test_project_structure.py with 13 unit tests
- All tests passing (13/13)

Refs: T01
This commit is contained in:
Luca Sacchi Ricciardi
2026-04-07 09:44:41 +02:00
parent 849a65d4d9
commit 75f40acb17
27 changed files with 3094 additions and 0 deletions

0
tests/unit/__init__.py Normal file
View File

Binary file not shown.

View File

@@ -0,0 +1,90 @@
"""Test for project structure setup (T01)."""
import os
import pytest
@pytest.mark.unit
class TestProjectStructure:
"""Test project directory structure is correctly created."""
def test_src_directory_exists(self):
"""Verify src/openrouter_monitor/ directory exists."""
src_path = "/home/google/Sources/LucaSacchiNet/openrouter-watcher/src/openrouter_monitor"
assert os.path.isdir(src_path), f"Directory {src_path} does not exist"
def test_src_init_file_exists(self):
"""Verify src/openrouter_monitor/__init__.py exists."""
init_path = "/home/google/Sources/LucaSacchiNet/openrouter-watcher/src/openrouter_monitor/__init__.py"
assert os.path.isfile(init_path), f"File {init_path} does not exist"
def test_main_py_exists(self):
"""Verify main.py exists in src."""
main_path = "/home/google/Sources/LucaSacchiNet/openrouter-watcher/src/openrouter_monitor/main.py"
assert os.path.isfile(main_path), f"File {main_path} does not exist"
def test_config_py_exists(self):
"""Verify config.py exists in src."""
config_path = "/home/google/Sources/LucaSacchiNet/openrouter-watcher/src/openrouter_monitor/config.py"
assert os.path.isfile(config_path), f"File {config_path} does not exist"
def test_database_py_exists(self):
"""Verify database.py exists in src."""
db_path = "/home/google/Sources/LucaSacchiNet/openrouter-watcher/src/openrouter_monitor/database.py"
assert os.path.isfile(db_path), f"File {db_path} does not exist"
def test_models_directory_exists(self):
"""Verify models/ directory exists with __init__.py."""
models_path = "/home/google/Sources/LucaSacchiNet/openrouter-watcher/src/openrouter_monitor/models"
init_path = os.path.join(models_path, "__init__.py")
assert os.path.isdir(models_path), f"Directory {models_path} does not exist"
assert os.path.isfile(init_path), f"File {init_path} does not exist"
def test_routers_directory_exists(self):
"""Verify routers/ directory exists with __init__.py."""
routers_path = "/home/google/Sources/LucaSacchiNet/openrouter-watcher/src/openrouter_monitor/routers"
init_path = os.path.join(routers_path, "__init__.py")
assert os.path.isdir(routers_path), f"Directory {routers_path} does not exist"
assert os.path.isfile(init_path), f"File {init_path} does not exist"
def test_services_directory_exists(self):
"""Verify services/ directory exists with __init__.py."""
services_path = "/home/google/Sources/LucaSacchiNet/openrouter-watcher/src/openrouter_monitor/services"
init_path = os.path.join(services_path, "__init__.py")
assert os.path.isdir(services_path), f"Directory {services_path} does not exist"
assert os.path.isfile(init_path), f"File {init_path} does not exist"
def test_utils_directory_exists(self):
"""Verify utils/ directory exists with __init__.py."""
utils_path = "/home/google/Sources/LucaSacchiNet/openrouter-watcher/src/openrouter_monitor/utils"
init_path = os.path.join(utils_path, "__init__.py")
assert os.path.isdir(utils_path), f"Directory {utils_path} does not exist"
assert os.path.isfile(init_path), f"File {init_path} does not exist"
def test_tests_directory_structure(self):
"""Verify tests/ directory structure exists."""
tests_path = "/home/google/Sources/LucaSacchiNet/openrouter-watcher/tests"
unit_path = os.path.join(tests_path, "unit")
integration_path = os.path.join(tests_path, "integration")
conftest_path = os.path.join(tests_path, "conftest.py")
assert os.path.isdir(tests_path), f"Directory {tests_path} does not exist"
assert os.path.isdir(unit_path), f"Directory {unit_path} does not exist"
assert os.path.isfile(os.path.join(unit_path, "__init__.py")), f"unit/__init__.py does not exist"
assert os.path.isdir(integration_path), f"Directory {integration_path} does not exist"
assert os.path.isfile(os.path.join(integration_path, "__init__.py")), f"integration/__init__.py does not exist"
assert os.path.isfile(conftest_path), f"File {conftest_path} does not exist"
def test_alembic_directory_exists(self):
"""Verify alembic/ directory exists."""
alembic_path = "/home/google/Sources/LucaSacchiNet/openrouter-watcher/alembic"
assert os.path.isdir(alembic_path), f"Directory {alembic_path} does not exist"
def test_docs_directory_exists(self):
"""Verify docs/ directory exists."""
docs_path = "/home/google/Sources/LucaSacchiNet/openrouter-watcher/docs"
assert os.path.isdir(docs_path), f"Directory {docs_path} does not exist"
def test_scripts_directory_exists(self):
"""Verify scripts/ directory exists."""
scripts_path = "/home/google/Sources/LucaSacchiNet/openrouter-watcher/scripts"
assert os.path.isdir(scripts_path), f"Directory {scripts_path} does not exist"