1
0
personal-data/test/test_obsidian_format.py
Jon Michael Aanes c8c142bd1b
Some checks failed
Test Python / Test (push) Failing after 32s
Obsidian import: More intelligent time behaviour
2024-10-16 23:58:22 +02:00

19 lines
640 B
Python

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"),
]
@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