-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Background
The CronJob
class in supertask/model.py
has properties (duration
, elapsed
) and a method (delta_duration
) that currently lack test coverage.
Required Tests
Unit tests should be added to cover:
- Finished job: When
end
is set,duration
should return(end – start).total_seconds()
. - Unfinished job: When
end
isNone
,duration
should raiseRuntimeError("Job has not finished yet")
. - Elapsed time: When
end
isNone
,elapsed
should return(now – start).total_seconds()
without raising an exception. - delta_duration: Conversion of a
timedelta
to seconds (e.g., 1 hour → 3600 seconds).
Suggested Implementation
Create tests under tests/
(e.g., tests/test_cronjob.py
) that exercise these scenarios.
References
This issue was identified during code review:
Metadata
Metadata
Assignees
Labels
No labels