Skip to content

Commit 58398b3

Browse files
committed
fix: update FakeBackend/config test doubles for the new complete() signature
The previous commit added an optional system_prompt kwarg to LLMBackend.complete() (and a get_prompt_addition() call on the config passed into generate_parent_module_docs), but two test doubles didn't get updated to match: - FakeBackend.complete() in test_processing_order_update.py and test_updater_orchestrator.py didn't accept system_prompt, so generate_parent_module_docs's `backend.complete(prompt, system_prompt=...)` call raised TypeError. - The SimpleNamespace fake config in test_processing_order_update.py had no get_prompt_addition(), so the AttributeError below. CI: 3 failed (AttributeError: 'SimpleNamespace' object has no attribute 'get_prompt_addition'; TypeError: FakeBackend.complete() got an unexpected keyword argument 'system_prompt').
1 parent 98857e4 commit 58398b3

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎tests/test_processing_order_update.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,17 @@ async def run_module_agent(
7878
Path(working_dir, f"{module_name}.md").write_text(f"# {module_name}\n")
7979
return module_tree
8080

81-
def complete(self, prompt, model=None):
81+
def complete(self, prompt, model=None, system_prompt=None):
8282
self.complete_calls += 1
8383
return "<OVERVIEW>overview</OVERVIEW>"
8484

8585

8686
def _generator(docs_dir: Path) -> tuple[DocumentationGenerator, FakeBackend]:
8787
# Bypass __init__: it wires a real LLM backend and dependency analyzer.
8888
gen = object.__new__(DocumentationGenerator)
89-
gen.config = SimpleNamespace(docs_dir=str(docs_dir), repo_path=str(docs_dir))
89+
gen.config = SimpleNamespace(
90+
docs_dir=str(docs_dir), repo_path=str(docs_dir), get_prompt_addition=lambda: ""
91+
)
9092
gen.backend = FakeBackend(docs_dir)
9193
return gen, gen.backend
9294

‎tests/test_updater_orchestrator.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(self, own_verdict="patch"):
2929
self.complete_calls = []
3030
self.last_usage = None
3131

32-
def complete(self, prompt, *, model=None):
32+
def complete(self, prompt, *, model=None, system_prompt=None):
3333
self.complete_calls.append(prompt[:80])
3434
self.last_usage = {"prompt_tokens": 10, "completion_tokens": 5}
3535
return "<OVERVIEW>regenerated overview</OVERVIEW>"

0 commit comments

Comments
 (0)