diff --git a/tests/test_schedule.py b/tests/test_schedule.py index e4931da..6c7b7f8 100644 --- a/tests/test_schedule.py +++ b/tests/test_schedule.py @@ -33,7 +33,7 @@ prog_key="763244309190298696786072636901190268976229595667748695826878", maxpriority=100, startdate=date(2021, 1, 1), - enddate=date(2023, 12, 31), + enddate=date(3023, 12, 31), ) diff --git a/wintertoo/validate.py b/wintertoo/validate.py index 347c0a2..157aba8 100644 --- a/wintertoo/validate.py +++ b/wintertoo/validate.py @@ -209,15 +209,21 @@ def validate_target_dates( err = None if start_time > stop_time: - err = f"Start time '{start_time}' is after stop time '{stop_time}'." + err = ( + f"Start time '{start_time.isot}' is after stop time '{stop_time.isot}'." + ) elif start_time < program_start_date: err = ( - f"Start time '{start_time}' is before program start date '{stop_time}'" + f"Start time '{start_time.isot}' is before " + f"program start date '{program_start_date.isot}'" ) elif stop_time > program_end_date: - err = f"Stop time '{start_time}' is after program end date '{stop_time}'" + err = ( + f"Stop time '{start_time.isot}' is after " + f"program end date '{program_end_date.isot}'" + ) if err is not None: logger.error(err) @@ -236,6 +242,7 @@ def validate_schedule_request( # pylint: disable=too-many-arguments """ Central to validate that a schedule request is allowed. Raises an error if not. + :param schedule_request: Schedule to validate :param program_name: name of program e.g 2020A000 :param program_api_key: unique API key for program