def test_basic(self): c = Calendar() c = c.add(Day("came 9 left 15 lunch 30m", today)) c, _ = c.undo() c, date_ = c.redo() assert "30" in ConsoleDayShower(c).show_days(today, 1) assert date_ == today
def test_only_came(self): c = Calendar() c = c.add(Day("came 9", today)) assert "09:00" in ConsoleDayShower(c).show_days(today, 1) c, date_ = c.undo() assert "09:00" not in ConsoleDayShower(c).show_days(today, 1) assert date_ == today
def test_return_none_instead_of_date_if_nothing_to_undo(self): c = Calendar() c, date_ = c.undo() assert date_ is None
def test_came_left_lunch(self): c = Calendar() c = c.add(Day("came 9 left 15 lunch 30m", today)) assert "30" in ConsoleDayShower(c).show_days(today, 1) c, _ = c.undo() assert "30" not in ConsoleDayShower(c).show_days(today, 1)