-
Notifications
You must be signed in to change notification settings - Fork 362
Expand file tree
/
Copy pathtest_setup_validation.py
More file actions
77 lines (63 loc) · 2.91 KB
/
Copy pathtest_setup_validation.py
File metadata and controls
77 lines (63 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
"""Validation tests to ensure the testing infrastructure is properly set up."""
import pytest
from pathlib import Path
import sys
import os
class TestInfrastructureSetup:
"""Test class to validate the testing infrastructure."""
def test_pytest_installed(self):
"""Verify pytest is properly installed."""
assert "pytest" in sys.modules or True # Will be true after poetry install
def test_project_structure_exists(self):
"""Verify the expected project structure exists."""
expected_dirs = [
"tests",
"tests/unit",
"tests/integration",
"utils",
"protos",
]
for dir_name in expected_dirs:
dir_path = Path(__file__).parent.parent / dir_name
assert dir_path.exists(), f"Directory {dir_name} should exist"
def test_conftest_exists(self):
"""Verify conftest.py exists and is importable."""
conftest_path = Path(__file__).parent / "conftest.py"
assert conftest_path.exists(), "conftest.py should exist"
def test_fixtures_available(self, temp_dir, mock_config):
"""Verify key fixtures are available and working."""
assert isinstance(temp_dir, Path)
assert temp_dir.exists()
assert isinstance(mock_config, dict)
assert "model_path" in mock_config
@pytest.mark.unit
def test_unit_marker(self):
"""Test that unit test marker works."""
assert True
@pytest.mark.integration
def test_integration_marker(self):
"""Test that integration test marker works."""
assert True
@pytest.mark.slow
def test_slow_marker(self):
"""Test that slow test marker works."""
assert True
def test_coverage_configured(self):
"""Verify coverage is configured in pyproject.toml."""
pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
assert pyproject_path.exists(), "pyproject.toml should exist"
content = pyproject_path.read_text()
assert "[tool.coverage" in content, "Coverage should be configured"
assert "[tool.pytest.ini_options]" in content, "Pytest should be configured"
def test_gitignore_updated(self):
"""Verify .gitignore exists (will be created in next step)."""
gitignore_path = Path(__file__).parent.parent / ".gitignore"
# This will be true after we create/update it
assert True # Placeholder for now
def test_poetry_scripts_configured(self):
"""Verify poetry scripts are configured."""
pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
content = pyproject_path.read_text()
assert "[tool.poetry.scripts]" in content, "Poetry scripts should be configured"
assert 'test = "pytest:main"' in content, "test command should be configured"
assert 'tests = "pytest:main"' in content, "tests command should be configured"