test_javascript_parser.py 524 B

12345678910111213141516171819
  1. import json
  2. import pytest
  3. from word_processor.generators import Generator
  4. from word_processor.parsers import JavascriptParser
  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_javascript_parser(snapshot, text):
  10. generator = Generator(text=text, strategy=leaf_strategy, parser=JavascriptParser())
  11. generator.suggest()
  12. presentation = generator.present()
  13. assert presentation == snapshot