@@ -18,10 +18,15 @@ def test_template_module_structure() -> None:
1818 import importlib .util
1919 import sys
2020
21+ # Anchor path to repo root (3 levels up from this test file: tests/unit/api/)
22+ test_file = Path (__file__ ).resolve ()
23+ repo_root = test_file .parents [3 ]
24+ template_file = repo_root / "services" / "api" / "src" / "byte_api" / "lib" / "template.py"
25+
2126 # Load template module directly
2227 spec = importlib .util .spec_from_file_location (
2328 "template" ,
24- "/Users/coffee/git/public/JacobCoffee/byte/worktrees/phase3.4-tests-api/services/api/src/byte_api/lib/template.py" ,
29+ template_file ,
2530 )
2631 if spec and spec .loader :
2732 template_module = importlib .util .module_from_spec (spec )
@@ -114,9 +119,12 @@ def test_template_file_exists() -> None:
114119
115120def test_template_module_docstring () -> None :
116121 """Test template.py has docstring."""
117- with open (
118- "/Users/coffee/git/public/JacobCoffee/byte/worktrees/phase3.4-tests-api/services/api/src/byte_api/lib/template.py"
119- ) as f :
122+ # Anchor path to repo root (3 levels up from this test file: tests/unit/api/)
123+ test_file = Path (__file__ ).resolve ()
124+ repo_root = test_file .parents [3 ]
125+ template_file = repo_root / "services" / "api" / "src" / "byte_api" / "lib" / "template.py"
126+
127+ with open (template_file ) as f :
120128 content = f .read ()
121129
122130 # Should have module docstring
@@ -125,9 +133,12 @@ def test_template_module_docstring() -> None:
125133
126134def test_template_module_imports () -> None :
127135 """Test template.py imports expected modules."""
128- with open (
129- "/Users/coffee/git/public/JacobCoffee/byte/worktrees/phase3.4-tests-api/services/api/src/byte_api/lib/template.py"
130- ) as f :
136+ # Anchor path to repo root (3 levels up from this test file: tests/unit/api/)
137+ test_file = Path (__file__ ).resolve ()
138+ repo_root = test_file .parents [3 ]
139+ template_file = repo_root / "services" / "api" / "src" / "byte_api" / "lib" / "template.py"
140+
141+ with open (template_file ) as f :
131142 content = f .read ()
132143
133144 # Should import TemplateConfig
@@ -138,9 +149,12 @@ def test_template_module_imports() -> None:
138149
139150def test_template_module_config_variable () -> None :
140151 """Test template.py defines config variable."""
141- with open (
142- "/Users/coffee/git/public/JacobCoffee/byte/worktrees/phase3.4-tests-api/services/api/src/byte_api/lib/template.py"
143- ) as f :
152+ # Anchor path to repo root (3 levels up from this test file: tests/unit/api/)
153+ test_file = Path (__file__ ).resolve ()
154+ repo_root = test_file .parents [3 ]
155+ template_file = repo_root / "services" / "api" / "src" / "byte_api" / "lib" / "template.py"
156+
157+ with open (template_file ) as f :
144158 content = f .read ()
145159
146160 # Should define config
0 commit comments