def end_last_task(date: str, time: str): if not is_date_valid(date): raise ValueError(f'{date} is not a valid date format') if time == '': time = str(WdcTime.now()) if not is_time_valid(time): raise ValueError(f'{date} is not a valid date format') task = last_task(date) task.end = time task.timestamp = timestamp() write_task(task)
def test_now_one_digit(self): test_object = WdcTime.now() self.assertEqual('0808', str(test_object))
def test_now_two_digit(self): test_object = WdcTime.now() self.assertEqual('1516', str(test_object))