1
0
favro-sync/test/test_markdown_parsing.py

28 lines
500 B
Python
Raw Normal View History

from favro_sync.favro_markdown import CardFileFormatter
2024-09-27 14:13:03 +00:00
EXAMPLE_TEXT_1 = '''
---
aliases:
- Hello World
---
2024-09-27 14:13:03 +00:00
# Hello World
2024-09-27 14:13:03 +00:00
Test description
## Other header
1. Derp
2. Derp
3. Derp
'''.strip()
FORMATTER = CardFileFormatter()
2024-09-27 14:13:03 +00:00
def test_parse_and_render():
card_contents = FORMATTER.parse_card_contents(EXAMPLE_TEXT_1)
assert card_contents.name == 'Hello World'
assert '---' not in card_contents.description
assert FORMATTER.format_card_contents(card_contents) == EXAMPLE_TEXT_1