fix: resolve CI/CD issues - remove unused imports and fix type mismatches
Some checks failed
CI / test (push) Has been cancelled
CI / build (push) Has been cancelled

This commit is contained in:
2026-02-02 02:56:08 +00:00
parent c53c5ee157
commit dc50ba4765

View File

@@ -1,4 +1,3 @@
import pytest
import tempfile
import json
from pathlib import Path
@@ -27,7 +26,7 @@ class Greeter:
def greet(self, name):
if self.prefix and name:
return f"{self.prefix} {name}"
return "Hello
return "Hello"
""")
parser = PythonParser()
@@ -187,7 +186,23 @@ def func_b():
file_nodes = [n for n in nodes if n.node_type.value == "file"]
func_nodes = [n for n in nodes if n.node_type.value == "function"]
class_nodes = [n for n in nodes if n.node_type.value == "class"]
assert len(file_nodes) == 3
assert len(func_nodes) >= 3
def test_error_handling_invalid_file(self):
parser = PythonParser()
result = parser.parse(Path("/nonexistent/file.py"), "")
assert result.errors is not None
def test_empty_code_handling(self):
with tempfile.TemporaryDirectory() as tmpdir:
test_file = Path(tmpdir) / "empty.py"
test_file.write_text("# Just a comment\n")
parser = PythonParser()
content = test_file.read_text()
result = parser.parse(test_file, content)
assert result.language == "python"