Test_AI_Classification / test_app.py
Boukabous
first commit
cf08f42
raw
history blame
921 Bytes
import pytest
from app import predict_ai_text
def test_basic_ai_detection():
# Simple test input
text = "This article explores the evolution of artificial intelligence in modern society."
result = predict_ai_text(text)
# Check it's a string and includes expected keywords
assert isinstance(result, str)
assert "Confidence" in result
assert any(label in result for label in ["AI-Generated", "Human-Written"])
def test_empty_input():
result = predict_ai_text("")
assert isinstance(result, str)
assert "Confidence" in result
@pytest.mark.parametrize(
"text",
[
"The quick brown fox jumps over the lazy dog.",
"As technology advances, so does our understanding of machine learning.",
"Hello world!",
],
)
def test_multiple_inputs(text):
result = predict_ai_text(text)
assert isinstance(result, str)
assert "Confidence" in result