def test_priority_setter_exception(self): todo_entry = TodoEntry( 'x (A) Make @Cute +T1 +T2 c1:c2 c3:c4 with c-c-c-c-c') with self.assertRaises(ValueError) as cm: todo_entry.priority = 'AA' with self.assertRaises(TypeError) as cm: todo_entry.priority = 5 with self.assertRaises(TypeError) as cm: todo_entry.priority = TodoEntry('')
def test_priority_setter_positive(initial_entry, result_entry, priority_value): todo_entry = TodoEntry(initial_entry) todo_entry.priority = priority_value assert str(todo_entry) == result_entry
def test_equality(self): entry1 = TodoEntry('(A) Make @Cute +T1 +T2 c1:c2 c3:c4 with c-c-c-c-c') entry2 = TodoEntry('(B) Make @Cute +T1 +T2 c1:c2 c3:c4 with c-c-c-c-c') entry2.priority = 'A' self.assertEqual(entry1, entry2)