Esempio n. 1
0
    def __init__(self, task_id: str, timezone: Union[T_PYTZ, str], *, id: str = None,
                 args: Union[tuple, list] = (), kwargs: Dict[str, Any] = None,
                 misfire_grace_time: Real = None):
        assert check_argument_types()
        if misfire_grace_time is not None and misfire_grace_time <= 0:
            raise ValueError('misfire_grace_time must be a positive integer or None')

        self.task_id = task_id
        self.timezone = as_timezone(timezone)
        self.id = id or uuid4().hex
        self.args = tuple(args)
        self.kwargs = kwargs or {}
        self.misfire_grace_time = misfire_grace_time
Esempio n. 2
0
def test_as_timezone(input, expected):
    assert as_timezone(input) == expected
def test_as_timezone(input, expected):
    assert as_timezone(input) == expected