Skip to content

Commit

Permalink
ruff is happier
Browse files Browse the repository at this point in the history
  • Loading branch information
geier committed Oct 31, 2023
1 parent 87da36b commit 16bb6c9
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions tests/event_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,25 +690,35 @@ def test_timezone_creation_with_arbitrary_dates(freeze_ts, event_time):


def test_partstat():
FORMAT_CALENDAR = ('{calendar-color}{partstat-symbol}{status-symbol}{start-end-time-style} ({calendar}) '
'{title} [{location}]{repeat-symbol}')
FORMAT_CALENDAR = (
'{calendar-color}{partstat-symbol}{status-symbol}{start-end-time-style} ({calendar}) '
'{title} [{location}]{repeat-symbol}'
)

event = Event.fromString(_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS)
event = Event.fromString(
_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS)
assert event.partstat == 'ACCEPTED'
assert event.format(FORMAT_CALENDAR, dt.date(2014, 4, 9)) == ' ✔09:30-10:30 (foobar) An Event []\x1b[0m'
assert event.format(FORMAT_CALENDAR, dt.date(2014, 4, 9)) == \
' ✔09:30-10:30 (foobar) An Event []\x1b[0m'

event = Event.fromString(_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS)
event = Event.fromString(
_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS)
assert event.partstat == 'DECLINED'
assert event.format(FORMAT_CALENDAR, dt.date(2014, 4, 9)) == ' ❌09:30-10:30 (foobar) An Event []\x1b[0m'
assert event.format(FORMAT_CALENDAR, dt.date(2014, 4, 9)) == \
' ❌09:30-10:30 (foobar) An Event []\x1b[0m'

event = Event.fromString(_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS)
event = Event.fromString(
_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS)
assert event.partstat == 'ACCEPTED'
assert event.format(FORMAT_CALENDAR, dt.date(2014, 4, 9)) == ' ✔09:30-10:30 (foobar) An Event []\x1b[0m'
assert event.format(FORMAT_CALENDAR, dt.date(2014, 4, 9)) == \
' ✔09:30-10:30 (foobar) An Event []\x1b[0m'

@pytest.mark.xfail
def test_partstat_deligated():
event = Event.fromString(_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS)
event = Event.fromString(
_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS)
assert event.partstat == 'ACCEPTED'

event = Event.fromString(_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS)
event = Event.fromString(
_get_text('event_dt_partstat'), address='[email protected]', **EVENT_KWARGS)
assert event.partstat == 'ACCEPTED'

0 comments on commit 16bb6c9

Please sign in to comment.