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