Create test_model.py
Browse files- test_model.py +18 -0
test_model.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pytest
|
| 2 |
+
from inference import predict
|
| 3 |
+
from utils import preprocess_text
|
| 4 |
+
|
| 5 |
+
def test_preprocessing():
|
| 6 |
+
text = " Hello World "
|
| 7 |
+
processed = preprocess_text(text)
|
| 8 |
+
assert processed == "Hello World"
|
| 9 |
+
|
| 10 |
+
def test_prediction():
|
| 11 |
+
# Test with simple input
|
| 12 |
+
result = predict("Test input")
|
| 13 |
+
assert isinstance(result, list)
|
| 14 |
+
print("Basic tests passed!")
|
| 15 |
+
|
| 16 |
+
if __name__ == "__main__":
|
| 17 |
+
test_preprocessing()
|
| 18 |
+
test_prediction()
|