1
0
libpurple-to-markdown/test/test_markdown_format.py
Jon Michael Aanes 34988440fd
All checks were successful
Run Python tests (through Pytest) / Test (push) Successful in 23s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 21s
Remove redundant whitespace on end of line (for an even weird edge case)
2024-11-04 22:52:21 +01:00

33 lines
582 B
Python

import datetime
from libpurple_to_markdown.data import Message
from libpurple_to_markdown.markdown import format_messages
NOW = datetime.datetime.fromtimestamp(1_000_000_000, tz=datetime.UTC)
TEXT_1 = 'Hello \n \nWorld \n '
EXPECTED_1 = """# Test
---
## [[2001-09-09]]
2001-09-09 01:46:40 [[Test Sender]]:
> Hello
>
> World
2001-09-09 01:46:40 [[Test Sender]]:
> Hello
>
> World
"""
def test_whitespace_at_end_of_line():
msg = Message(NOW, 'Test Sender', TEXT_1, 'Test Chat')
result = format_messages([msg, msg], title='Test')
assert result == EXPECTED_1