Skip to content

Commit

Permalink
Add test for absolute reminder missing fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzmoyev committed Oct 15, 2024
1 parent 4a29291 commit c0efe58
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/test_reminder.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ def test_absolute_reminders_conversion(self):
self.assertEqual(reminder.method, 'popup')
self.assertEqual(reminder.minutes_before_start, 4 * 24 * 60 + 13 * 60 + 35)

def test_absolute_reminder_conversion_missing_fields(self):
absolute_reminder = PopupReminder(days_before=5, at=time(10, 25))
absolute_reminder.at = None
with self.assertRaises(ValueError):
absolute_reminder.convert_to_relative(16 / Apr / 2024)

absolute_reminder = PopupReminder(days_before=5, at=time(10, 25))
absolute_reminder.days_before = None
with self.assertRaises(ValueError):
absolute_reminder.convert_to_relative(16 / Apr / 2024)

def test_reminder_checks(self):
# No time provided
with self.assertRaises(ValueError):
Expand Down

0 comments on commit c0efe58

Please sign in to comment.