From 87ee83d3ee4779c069fac549dc74e56f5750b2d6 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Mon, 29 Jun 2026 13:27:05 +1000 Subject: [PATCH] Fix tests --- src/jinjaturtle/core.py | 12 ------------ src/jinjaturtle/j2.py | 1 - src/jinjaturtle/output_safety.py | 9 --------- tests/test_yaml_handler.py | 2 +- 4 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/jinjaturtle/core.py b/src/jinjaturtle/core.py index 72b42de..d86992b 100644 --- a/src/jinjaturtle/core.py +++ b/src/jinjaturtle/core.py @@ -448,18 +448,6 @@ def generate_jinja2_template( return template -def _template_variable_names( - role_prefix: str, - flat_items: list[tuple[tuple[str, ...], Any]], - loop_candidates: list[LoopCandidate] | None = None, -) -> set[str]: - names = {make_var_name(role_prefix, path) for path, _value in flat_items} - if loop_candidates: - for candidate in loop_candidates: - names.add(make_var_name(role_prefix, candidate.path)) - return names - - def _stringify_timestamps(obj: Any) -> Any: """ Recursively walk a parsed config and turn any datetime/date/time objects diff --git a/src/jinjaturtle/j2.py b/src/jinjaturtle/j2.py index 13531f5..e20ed20 100644 --- a/src/jinjaturtle/j2.py +++ b/src/jinjaturtle/j2.py @@ -2,7 +2,6 @@ from __future__ import annotations from typing import Any -NAME = "jinja2" TEMPLATE_EXTENSION = "j2" JSON_VALUE_FILTER = "to_json(ensure_ascii=False)" diff --git a/src/jinjaturtle/output_safety.py b/src/jinjaturtle/output_safety.py index 9833cde..8b0b4d1 100644 --- a/src/jinjaturtle/output_safety.py +++ b/src/jinjaturtle/output_safety.py @@ -24,15 +24,6 @@ def _absolute(path: Path) -> Path: return path if path.is_absolute() else Path.cwd() / path -def _check_existing_path_not_symlink(path: Path) -> None: - try: - st = path.lstat() - except FileNotFoundError: - return - if stat.S_ISLNK(st.st_mode): - raise OutputPathError(f"refusing to use symlink path: {path}") - - def _check_existing_output_file(path: Path) -> None: try: st = path.lstat() diff --git a/tests/test_yaml_handler.py b/tests/test_yaml_handler.py index 548f5a6..a41baf4 100644 --- a/tests/test_yaml_handler.py +++ b/tests/test_yaml_handler.py @@ -187,7 +187,7 @@ def test_yaml_loop_preserves_blank_separator_after_list(tmp_path: Path): ), ] - for label, text, rendered_expected, erb_expected in cases: + for label, text, rendered_expected in cases: path = tmp_path / f"{label}.yml" path.write_text(text, encoding="utf-8")