Example #1
0
def get_schedule_at(at: Optional[str]) -> Optional[datetime.datetime]:
    if at is None:
        return None

    try:
        dt = utils.parse_datetime(at)
    except ValueError:
        raise click.BadOptionUsage("--at", f"Cannot parse datetime {at}")

    return dt
Example #2
0
def test_parse_datetime(input, expected):
    assert utils.parse_datetime(input) == expected