Skip to content

Commit 455b73b

Browse files
committed
Update test_suite_python.py
1 parent a8f0d74 commit 455b73b

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

tests/test_suite_python.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import sqlite3
88

99
# --- SETUP PER I TEST ---
10-
test_app = typer.Typer()
11-
test_app.command()(main)
10+
app_test = typer.Typer()
11+
app_test.command()(main)
1212

1313
runner = CliRunner()
1414

@@ -80,7 +80,7 @@ def test_python_light_advanced(self, tmp_path):
8080
self.create_dummy_project(tmp_path)
8181
output_file = tmp_path / "context.md"
8282

83-
result = runner.invoke(test_app, [str(tmp_path), "--light", "-o", str(output_file)])
83+
result = runner.invoke(app_test, [str(tmp_path), "--light", "-o", str(output_file)])
8484

8585
assert result.exit_code == 0
8686
content = output_file.read_text(encoding="utf-8")
@@ -105,7 +105,7 @@ def test_markdown_parsing(self, tmp_path):
105105
self.create_dummy_project(tmp_path)
106106
output_file = tmp_path / "context.md"
107107

108-
result = runner.invoke(test_app, [str(tmp_path), "--light", "-o", str(output_file)])
108+
result = runner.invoke(app_test, [str(tmp_path), "--light", "-o", str(output_file)])
109109
content = output_file.read_text(encoding="utf-8")
110110

111111
assert "# Project Title" in content
@@ -118,7 +118,7 @@ def test_latex_parsing(self, tmp_path):
118118
self.create_dummy_project(tmp_path)
119119
output_file = tmp_path / "context.md"
120120

121-
result = runner.invoke(test_app, [str(tmp_path), "--light", "-o", str(output_file)])
121+
result = runner.invoke(app_test, [str(tmp_path), "--light", "-o", str(output_file)])
122122
content = output_file.read_text(encoding="utf-8")
123123

124124
assert r"\documentclass{article}" in content
@@ -133,7 +133,7 @@ def test_fallback_and_warning(self, tmp_path):
133133
self.create_dummy_project(tmp_path)
134134
output_file = tmp_path / "context.md"
135135

136-
result = runner.invoke(test_app, [str(tmp_path), "--light", "-o", str(output_file)])
136+
result = runner.invoke(app_test, [str(tmp_path), "--light", "-o", str(output_file)])
137137
content = output_file.read_text(encoding="utf-8")
138138

139139
# 1. Verifica che il contenuto JS sia presente (Fallback behavior)
@@ -148,7 +148,7 @@ def test_json_legacy_support(self, tmp_path):
148148
self.create_dummy_project(tmp_path)
149149
output_file = tmp_path / "context.md"
150150

151-
result = runner.invoke(test_app, [str(tmp_path), "--light", "-o", str(output_file)])
151+
result = runner.invoke(app_test, [str(tmp_path), "--light", "-o", str(output_file)])
152152
content = output_file.read_text(encoding="utf-8")
153153

154154
# Verifica struttura JSON
@@ -168,7 +168,7 @@ def test_database_handling(self, tmp_path):
168168
conn.close()
169169

170170
output_file = project_dir / "context.md"
171-
result = runner.invoke(test_app, [str(project_dir), "--light", "-o", str(output_file)])
171+
result = runner.invoke(app_test, [str(project_dir), "--light", "-o", str(output_file)])
172172

173173
assert result.exit_code == 0
174174
content = output_file.read_text(encoding="utf-8")
@@ -183,7 +183,7 @@ def test_focus_mode_hybrid(self, tmp_path):
183183

184184
# Focus su main.py. SENZA --light o --all, il comportamento standard
185185
# per i file NON in focus è di essere presenti SOLO nell'albero (tree).
186-
result = runner.invoke(test_app, [str(tmp_path), "--focus", "main.py", "-o", str(output_file)])
186+
result = runner.invoke(app_test, [str(tmp_path), "--focus", "main.py", "-o", str(output_file)])
187187

188188
assert result.exit_code == 0
189189
content = output_file.read_text(encoding="utf-8")
@@ -206,7 +206,7 @@ def test_ignore_files(self, tmp_path):
206206
(tmp_path / ".deepbase.toml").write_text('ignore_files = ["script.js"]', encoding="utf-8")
207207

208208
output_file = tmp_path / "context.md"
209-
result = runner.invoke(test_app, [str(tmp_path), "--light", "-o", str(output_file)])
209+
result = runner.invoke(app_test, [str(tmp_path), "--light", "-o", str(output_file)])
210210

211211
content = output_file.read_text(encoding="utf-8")
212212
assert "script.js" not in content
@@ -247,7 +247,7 @@ def test_javascript_react_parsing(self, tmp_path):
247247
""", encoding="utf-8")
248248

249249
output_file = tmp_path / "context.md"
250-
result = runner.invoke(test_app, [str(tmp_path), "--light", "-o", str(output_file)])
250+
result = runner.invoke(app_test, [str(tmp_path), "--light", "-o", str(output_file)])
251251

252252
content = output_file.read_text(encoding="utf-8")
253253

@@ -288,7 +288,7 @@ def test_deepbase_toml_ignore_dirs(self, tmp_path):
288288
(project_dir / ".deepbase.toml").write_text(toml_content, encoding="utf-8")
289289

290290
output_file = project_dir / "context.md"
291-
result = runner.invoke(test_app, [str(project_dir), "-o", str(output_file)])
291+
result = runner.invoke(app_test, [str(project_dir), "-o", str(output_file)])
292292

293293
assert result.exit_code == 0, f"Errore: {result.stdout}"
294294
content = output_file.read_text(encoding="utf-8")
@@ -319,7 +319,7 @@ def test_deepbase_toml_ignore_files(self, tmp_path):
319319
(project_dir / ".deepbase.toml").write_text(toml_content, encoding="utf-8")
320320

321321
output_file = project_dir / "context.md"
322-
result = runner.invoke(test_app, [str(project_dir), "-o", str(output_file)])
322+
result = runner.invoke(app_test, [str(project_dir), "-o", str(output_file)])
323323

324324
assert result.exit_code == 0, f"Errore: {result.stdout}"
325325
content = output_file.read_text(encoding="utf-8")
@@ -346,7 +346,7 @@ def test_deepbase_toml_significant_extensions(self, tmp_path):
346346
(project_dir / ".deepbase.toml").write_text(toml_content, encoding="utf-8")
347347

348348
output_file = project_dir / "context.md"
349-
result = runner.invoke(test_app, [str(project_dir), "-o", str(output_file)])
349+
result = runner.invoke(app_test, [str(project_dir), "-o", str(output_file)])
350350

351351
assert result.exit_code == 0, f"Errore: {result.stdout}"
352352
content = output_file.read_text(encoding="utf-8")
@@ -380,7 +380,7 @@ def test_deepbase_toml_combined_settings(self, tmp_path):
380380
(project_dir / ".deepbase.toml").write_text(toml_content, encoding="utf-8")
381381

382382
output_file = project_dir / "context.md"
383-
result = runner.invoke(test_app, [str(project_dir), "-o", str(output_file)])
383+
result = runner.invoke(app_test, [str(project_dir), "-o", str(output_file)])
384384

385385
assert result.exit_code == 0, f"Errore: {result.stdout}"
386386
content = output_file.read_text(encoding="utf-8")
@@ -403,14 +403,14 @@ def test_deepbase_toml_empty_or_invalid(self, tmp_path):
403403
(project_dir / ".deepbase.toml").write_text("", encoding="utf-8")
404404
output_file = project_dir / "context.md"
405405

406-
result = runner.invoke(test_app, [str(project_dir), "-o", str(output_file)])
406+
result = runner.invoke(app_test, [str(project_dir), "-o", str(output_file)])
407407
assert result.exit_code == 0, f"Errore con TOML vuoto: {result.stdout}"
408408

409409
# TOML malformato
410410
(project_dir / ".deepbase.toml").write_text("invalid toml content [[", encoding="utf-8")
411411
output_file2 = project_dir / "context2.md"
412412

413-
result = runner.invoke(test_app, [str(project_dir), "-o", str(output_file2)])
413+
result = runner.invoke(app_test, [str(project_dir), "-o", str(output_file2)])
414414
# Dovrebbe gestire l'errore gracefulmente usando defaults
415415
assert result.exit_code == 0, f"Errore con TOML malformato: {result.stdout}"
416416
content = output_file2.read_text(encoding="utf-8")
@@ -438,7 +438,7 @@ def test_deepbase_toml_not_in_root(self, tmp_path):
438438
(child_dir / "main.py").write_text("print('main')", encoding="utf-8")
439439

440440
output_file = child_dir / "context.md"
441-
result = runner.invoke(test_app, [str(child_dir), "-o", str(output_file)])
441+
result = runner.invoke(app_test, [str(child_dir), "-o", str(output_file)])
442442

443443
assert result.exit_code == 0, f"Errore: {result.stdout}"
444444
content = output_file.read_text(encoding="utf-8")
@@ -471,7 +471,7 @@ def test_ignore_dirs_nested_path(self, tmp_path):
471471
(project_dir / ".deepbase.toml").write_text(toml_content, encoding="utf-8")
472472

473473
output_file = project_dir / "context.md"
474-
result = runner.invoke(test_app, [str(project_dir), "-o", str(output_file)])
474+
result = runner.invoke(app_test, [str(project_dir), "-o", str(output_file)])
475475

476476
assert result.exit_code == 0, f"Errore: {result.stdout}"
477477
content = output_file.read_text(encoding="utf-8")
@@ -504,7 +504,7 @@ def test_ignore_files_with_path(self, tmp_path):
504504

505505
output_file = project_dir / "context.md"
506506
# Aggiungi --all per includere il contenuto dei file
507-
result = runner.invoke(test_app, [str(project_dir), "--all", "-o", str(output_file)])
507+
result = runner.invoke(app_test, [str(project_dir), "--all", "-o", str(output_file)])
508508

509509
assert result.exit_code == 0, f"Errore: {result.stdout}"
510510
content = output_file.read_text(encoding="utf-8")
@@ -535,7 +535,7 @@ def test_ignore_files_wildcard(self, tmp_path):
535535
(project_dir / ".deepbase.toml").write_text(toml_content, encoding="utf-8")
536536

537537
output_file = project_dir / "context.md"
538-
result = runner.invoke(test_app, [str(project_dir), "-o", str(output_file)])
538+
result = runner.invoke(app_test, [str(project_dir), "-o", str(output_file)])
539539

540540
assert result.exit_code == 0, f"Errore: {result.stdout}"
541541
content = output_file.read_text(encoding="utf-8")
@@ -563,7 +563,7 @@ def test_ignore_dirs_wildcard(self, tmp_path):
563563
(project_dir / ".deepbase.toml").write_text(toml_content, encoding="utf-8")
564564

565565
output_file = project_dir / "context.md"
566-
result = runner.invoke(test_app, [str(project_dir), "-o", str(output_file)])
566+
result = runner.invoke(app_test, [str(project_dir), "-o", str(output_file)])
567567

568568
assert result.exit_code == 0, f"Errore: {result.stdout}"
569569
content = output_file.read_text(encoding="utf-8")
@@ -595,7 +595,7 @@ def test_ignore_dirs_nested_vs_global(self, tmp_path):
595595
(project_dir / ".deepbase.toml").write_text(toml_content, encoding="utf-8")
596596

597597
output_file = project_dir / "context.md"
598-
result = runner.invoke(test_app, [str(project_dir), "-o", str(output_file)])
598+
result = runner.invoke(app_test, [str(project_dir), "-o", str(output_file)])
599599

600600
assert result.exit_code == 0
601601
content = output_file.read_text(encoding="utf-8")
@@ -624,7 +624,7 @@ def test_ignore_dirs_name_matches_everywhere(self, tmp_path):
624624
(project_dir / ".deepbase.toml").write_text(toml_content, encoding="utf-8")
625625

626626
output_file = project_dir / "context.md"
627-
result = runner.invoke(test_app, [str(project_dir), "-o", str(output_file)])
627+
result = runner.invoke(app_test, [str(project_dir), "-o", str(output_file)])
628628

629629
content = output_file.read_text(encoding="utf-8")
630630

0 commit comments

Comments
 (0)