Spaces:
Sleeping
Sleeping
Download test_app.py from mboukabous/Test_AI_Classification: direct link, hf CLI and curl.
- Browser
- Download file 921 Bytes
-
https://huggingface.co/spaces/mboukabous/Test_AI_Classification/resolve/cf08f42e7cad9bb7bced2eb76c9540fae988d9e1/test_app.py
- Command line
-
hf download hf://spaces/mboukabous/Test_AI_Classification@cf08f42e7cad9bb7bced2eb76c9540fae988d9e1/test_app.py
-
curl -L -o test_app.py https://huggingface.co/spaces/mboukabous/Test_AI_Classification/resolve/cf08f42e7cad9bb7bced2eb76c9540fae988d9e1/test_app.py
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 | |
| def test_multiple_inputs(text): | |
| result = predict_ai_text(text) | |
| assert isinstance(result, str) | |
| assert "Confidence" in result | |