Skip to content

armgit / kong

Public Imported from GitHub
0

The world's first agentic reverse engineer.

tweak tests

Amruth5d05d59674a1
diff --git a/tests/test_cli.py b/tests/test_cli.py
index f1d3041..1c74eee 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -10,49 +10,12 @@ from click.testing import CliRunner
from kong.__main__ import cli
-def test_version():
- runner = CliRunner()
- result = runner.invoke(cli, ["--version"])
- assert result.exit_code == 0
- assert "kong" in result.output.lower()
- assert "0.1.0" in result.output
-
-
-def test_help():
- runner = CliRunner()
- result = runner.invoke(cli, ["--help"])
- assert result.exit_code == 0
- assert "autonomous binary analysis" in result.output.lower()
-
-
-def test_analyze_help():
- runner = CliRunner()
- result = runner.invoke(cli, ["analyze", "--help"])
- assert result.exit_code == 0
- assert "BINARY" in result.output
-
-
def test_analyze_missing_binary():
runner = CliRunner()
result = runner.invoke(cli, ["analyze", "/nonexistent/binary"])
assert result.exit_code != 0
-def test_analyze_no_api_key(tmp_path):
- """When ANTHROPIC_API_KEY is not set, show setup instructions."""
- binary = tmp_path / "test_binary"
- binary.write_bytes(b"\x00" * 16)
-
- runner = CliRunner()
- with patch.dict("os.environ", {}, clear=True), \
- patch("kong.__main__.check_api_key", return_value=False):
- result = runner.invoke(cli, ["analyze", str(binary)])
-
- assert result.exit_code != 0
- assert "anthropic_api_key" in result.output.lower()
- assert "kong setup" in result.output.lower()
-
-
def test_analyze_no_ghidra_installed(tmp_path):
"""When Ghidra is not installed, show install instructions."""
binary = tmp_path / "test_binary"
@@ -68,17 +31,6 @@ def test_analyze_no_ghidra_installed(tmp_path):
assert "brew install ghidra" in result.output
-def test_bare_kong_shows_banner():
- """Running 'kong' with no subcommand shows banner and usage."""
- runner = CliRunner()
- result = runner.invoke(cli, [])
-
- assert result.exit_code == 0
- assert "KONG" in result.output or "kong" in result.output.lower()
- assert "kong analyze" in result.output.lower()
- assert "kong setup" in result.output.lower()
-
-
def test_setup_with_key_set():
"""Setup command detects existing API key."""
runner = CliRunner()
@@ -90,19 +42,6 @@ def test_setup_with_key_set():
assert "..." in result.output
-def test_info_requires_binary_arg():
- runner = CliRunner()
- result = runner.invoke(cli, ["info"])
- assert result.exit_code != 0
-
-
-def test_eval_help():
- runner = CliRunner()
- result = runner.invoke(cli, ["eval", "--help"])
- assert result.exit_code == 0
- assert "score" in result.output.lower() or "analysis" in result.output.lower()
-
-
def test_eval_with_test_data(tmp_path):
"""Run eval against a simple test case."""
import json