fix: fix directory structure and test files

This commit is contained in:
2026-05-03 13:02:50 -05:00
parent c2cda3f619
commit 4ee33c5eaf
5 changed files with 30 additions and 8 deletions

View File

@@ -9,19 +9,20 @@ from pathlib import Path
def test_build_command():
"""Test build command."""
result = subprocess.run(
[sys.executable, "-m", "tampy", "build", "test.tampy"],
[sys.executable, "-m", "tampy", "build", "tests/test.tampy"],
capture_output=True,
text=True,
env={**dict(os.environ), "PYTHONPATH": "src"}
)
assert result.returncode == 0
assert "Generated:" in result.stdout
assert Path("tests/test.py").exists()
def test_run_command():
"""Test run command."""
result = subprocess.run(
[sys.executable, "-m", "tampy", "run", "test.tampy"],
[sys.executable, "-m", "tampy", "run", "tests/test.tampy"],
capture_output=True,
text=True,
env={**dict(os.environ), "PYTHONPATH": "src"}
@@ -33,10 +34,10 @@ def test_run_command():
def test_file_extension_replacement():
"""Test that .tampy is replaced with .py."""
result = subprocess.run(
[sys.executable, "-m", "tampy", "build", "test.tampy"],
[sys.executable, "-m", "tampy", "build", "tests/test.tampy"],
capture_output=True,
text=True,
env={**dict(os.environ), "PYTHONPATH": "src"}
)
assert result.returncode == 0
assert Path("test.py").exists()
assert Path("tests/test.py").exists()