Simple-Text-Classifier / src /test_predict.py
github-actions[bot]
Sync from GitHub e9a00339708d14fd15e64679f58d1c321b37ea9d
e71990c
Raw
History Blame Contribute Delete
376 Bytes
import os
import pytest
from src.predict import LABEL_DECODER, predict
pytestmark = pytest.mark.skipif(
"HF_REPO_ID" not in os.environ, reason="requires HF_REPO_ID (downloads the real checkpoint)"
)
def test_predict_returns_known_label():
label = predict("Wall Street stocks rallied after the Federal Reserve meeting.")
assert label in LABEL_DECODER.values()