test_short_image_markdown.py 730 B

1234567891011121314151617181920212223
  1. import pytest
  2. from ..parser import parse
  3. @pytest.mark.parametrize(
  4. "text",
  5. [
  6. pytest.param("!(http://somewhere.com/image.jpg)", id="base"),
  7. pytest.param("! (space)", id="space-one-word"),
  8. pytest.param("! (space with other words)", id="space-multiple-words"),
  9. pytest.param(
  10. "Text before exclamation mark!(http://somewhere.com/image.jpg)",
  11. id="text-before-mark",
  12. ),
  13. pytest.param(
  14. "Text before with space in between! (sometext)", id="text-before-with-space"
  15. ),
  16. ],
  17. )
  18. def test_short_image_markdown(request_mock, user, snapshot, text):
  19. result = parse(text, request_mock, user)
  20. snapshot.assert_match(result["parsed_text"])