iris_log_reg_model / test_app.py
Uday Chitragar
stable
1cfefea
raw
history blame contribute delete
595 Bytes
import numpy as np
from app import predict_iris
def test_predict_iris():
# Test with known input values and expected output
assert predict_iris(5.1, 3.5, 1.4, 0.2) == "setosa"
assert predict_iris(6.9, 3.1, 5.4, 2.1) == "virginica"
# Test with out-of-range input values
assert predict_iris(0, 0, 0, 0) == "setosa"
assert predict_iris(10, 10, 10, 10) == "virginica"
# Test with random input values
assert predict_iris(5.8, 2.7, 3.9, 1.2) in ["versicolor", "virginica", "setosa"]
if __name__ == "__main__":
test_predict_iris()
print("All tests passed!")