1
0
personal-data/test/test_obsidian_format.py

20 lines
727 B
Python
Raw Normal View History

import datetime
import pytest
from obsidian_import import obsidian
EXAMPLES = [
obsidian.Event(datetime.time(12, 0, 0), datetime.time(12, 0, 0), "Ate",
"Lunch", "instantly"),
obsidian.Event(datetime.time(20, 0, 0), datetime.time(22, 0, 0),
"Watched", "Tom and Jerry", "on the *Television*"),
obsidian.Event(None, None, None, None, "Took a walk"),
2024-10-20 16:27:32 +00:00
obsidian.Event(None, None, None, None, "Watched [[Cyberpunk: Edgerunners]]."),
]
@pytest.mark.parametrize("event", EXAMPLES)
def test_format_preserves_information(event: obsidian.Event):
formatted = obsidian.format_event_string(event)
assert obsidian.parse_event_string(formatted) == event