import pytest
from pathlib import Path
from domin8.tools.diff_utils import normalize_diff
from domin8.tools.blast_radius import _count_repo_references
from domin8.git_ops import create_diff
def test_count_repo_references_python_import(tmp_path, monkeypatch):
# Create a temporary python file that imports domin8.config to increase fanout
repo_root = Path('.').resolve()
test_file = repo_root / 'tmp_fanout_ref.py'
try:
test_file.write_text('import domin8.config\n')
target = Path('src/domin8/config.py')
assert target.exists()
# target path relative
cnt = _count_repo_references(repo_root, str(target))
assert isinstance(cnt, int)
assert cnt >= 1
finally:
try:
test_file.unlink()
except Exception:
pass