test_leaf_strategy.py 445 B

123456789101112131415161718
  1. import pytest
  2. import spacy
  3. from spacy import displacy
  4. from src.strategies.leaf_strategy import leaf_strategy
  5. nlp = spacy.load("en_core_web_trf")
  6. @pytest.mark.parametrize('text, expected', [
  7. ('Regex for redacted phone numbers with extra info for PlayStation', ['PhoneNumberRegex', 'RedactedPhoneNumberRegex'])
  8. ])
  9. def test_leaf_strategy(text, expected):
  10. doc = nlp(text)
  11. result = leaf_strategy(doc)
  12. # assert result == expected