Skip to content

Commit

Permalink
Added test for init_transformers
Browse files Browse the repository at this point in the history
  • Loading branch information
fexfl committed Oct 29, 2024
1 parent 40b6b14 commit 2f13356
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion mailcom/test/test_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,21 @@ def test_init_spacy(get_instant):
get_instant.init_spacy("fr", "not_an_existing_spacy_model")


# TODO init_transformers
def test_init_transformers(get_instant):
# Test with default model and revision number
get_instant.init_transformers()
assert get_instant.ner_recognizer is not None

# Test with an invalid model
with pytest.raises(OSError):
get_instant.init_transformers(model="invalid-model")

# Test with an invalid revision number
with pytest.raises(OSError):
get_instant.init_transformers(
model="xlm-roberta-large-finetuned-conll03-english",
model_revision_number="invalid-revision",
)


def test_reset(get_default_fr):
Expand Down

0 comments on commit 2f13356

Please sign in to comment.