Skip to content

armgit / kong

Public Imported from GitHub
0

The world's first agentic reverse engineer.

update test files

Amruthaf2b22cb2856
diff --git a/tests/test_agent_analyzer.py b/tests/test_agent_analyzer.py
index 1b3e584..5443c31 100644
--- a/tests/test_agent_analyzer.py
+++ b/tests/test_agent_analyzer.py
@@ -1,5 +1,7 @@
"""Tests for the analyzer agent."""
+from __future__ import annotations
+
from unittest.mock import MagicMock, patch
from kong.agent.analyzer import (
diff --git a/tests/test_agent_prompts.py b/tests/test_agent_prompts.py
new file mode 100644
index 0000000..335a12e
--- /dev/null
+++ b/tests/test_agent_prompts.py
@@ -0,0 +1,25 @@
+"""Tests for prompt templates."""
+
+from __future__ import annotations
+
+from kong.agent.prompts import OUTPUT_SCHEMA, SYSTEM_PROMPT
+
+
+class TestPrompts:
+ def test_system_prompt_establishes_role(self):
+ assert "reverse engineer" in SYSTEM_PROMPT.lower()
+
+ def test_system_prompt_requests_json(self):
+ assert "JSON" in SYSTEM_PROMPT
+
+ def test_output_schema_has_required_fields(self):
+ for field in ["name", "signature", "confidence", "classification", "comments", "reasoning", "variables"]:
+ assert field in OUTPUT_SCHEMA
+
+ def test_output_schema_has_classification_values(self):
+ for cls in ["crypto", "networking", "io", "memory", "string", "math", "init", "cleanup", "handler", "parser", "utility", "unknown"]:
+ assert cls in OUTPUT_SCHEMA
+
+ def test_output_schema_has_confidence_guidelines(self):
+ assert "90-100" in OUTPUT_SCHEMA
+ assert "0-29" in OUTPUT_SCHEMA
diff --git a/tests/test_agent_queue.py b/tests/test_agent_queue.py
index fd6cd49..cc46baf 100644
--- a/tests/test_agent_queue.py
+++ b/tests/test_agent_queue.py
@@ -1,5 +1,7 @@
"""Tests for the work queue with call-graph ordering."""
+from __future__ import annotations
+
from kong.agent.queue import WorkItem, WorkQueue
from kong.ghidra.types import FunctionClassification, FunctionInfo
diff --git a/tests/test_agent_supervisor.py b/tests/test_agent_supervisor.py
index 1e522c5..300fd4e 100644
--- a/tests/test_agent_supervisor.py
+++ b/tests/test_agent_supervisor.py
@@ -1,8 +1,10 @@
"""Tests for the supervisor agent loop."""
-from unittest.mock import MagicMock, patch
+from __future__ import annotations
-from kong.agent.events import Event, EventType, Phase
+from unittest.mock import MagicMock
+
+from kong.agent.events import EventType, Phase
from kong.agent.models import FunctionResult
from kong.agent.supervisor import AnalysisStats, Supervisor
from kong.config import KongConfig, OutputConfig
diff --git a/tests/test_agent_triage.py b/tests/test_agent_triage.py
index f489f16..e10afb2 100644
--- a/tests/test_agent_triage.py
+++ b/tests/test_agent_triage.py
@@ -1,5 +1,7 @@
"""Tests for the triage agent and signature matching."""
+from __future__ import annotations
+
from pathlib import Path
from unittest.mock import MagicMock
diff --git a/tests/test_cli.py b/tests/test_cli.py
index bc4ee77..265d399 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -43,7 +43,7 @@ def test_analyze_no_ghidra_installed(tmp_path):
binary.write_bytes(b"\x00" * 16)
runner = CliRunner()
- with patch("kong.ghidra.environment.find_ghidra_install", return_value=None):
+ with patch("kong.config.find_ghidra_install", return_value=None):
result = runner.invoke(cli, ["analyze", str(binary)])
assert result.exit_code != 0