test_parser.py 494 B

1234567891011121314151617181920
  1. import json
  2. import pytest
  3. from word_processor.generators import Generator
  4. from word_processor.parsers import Parser
  5. from word_processor.strategies import leaf_strategy
  6. @pytest.mark.parametrize('text', [
  7. 'Regex for redacted phone numbers with extra info for PlayStation'
  8. ])
  9. def test_parser(snapshot, text):
  10. generator = Generator(text=text, strategy=leaf_strategy, parser=Parser())
  11. generator.suggest()
  12. presentation = generator.present()
  13. assert presentation == snapshot