Fix test files to match implementation
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-02-04 11:42:01 +00:00
parent f74e9e3f5c
commit 7614b51126

View File

@@ -1,14 +1,11 @@
"""Tests for shell generation module."""
import pytest
from unittest.mock import Mock, patch
from shellgenius.generation import (
ShellGenerator,
ShellParser,
ShellSafetyChecker,
PromptTemplates,
GeneratedScript,
)
@@ -59,7 +56,7 @@ class TestShellSafetyChecker:
checker = ShellSafetyChecker()
is_safe, warnings = checker.check_command("ls -la")
assert is_safe == True
assert is_safe
assert len(warnings) == 0
def test_dangerous_command(self):
@@ -67,7 +64,7 @@ class TestShellSafetyChecker:
checker = ShellSafetyChecker()
is_safe, warnings = checker.check_command("rm -rf /")
assert is_safe == False
assert not is_safe
assert any("DANGEROUS" in w for w in warnings)
def test_warning_patterns(self):
@@ -83,7 +80,7 @@ class TestShellSafetyChecker:
checker = ShellSafetyChecker()
result = checker.check_script(script)
assert result["is_safe"] == False
assert not result["is_safe"]
assert len(result["issues"]) > 0
@@ -100,7 +97,7 @@ class TestPromptTemplates:
"""Test explanation prompt creation."""
prompt = PromptTemplates.get_explain_prompt("echo hello", "bash")
assert "explain" in prompt
assert "Explain" in prompt
assert "echo hello" in prompt
def test_get_refactor_prompt(self):