Skip to content

Commit

Permalink
test: Add Job.__repr__ coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Jul 20, 2024
1 parent 6a205b8 commit 0af4c78
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_job.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import datetime

from scrapyd.jobstorage import Job


def test_job_repr():
job = Job(
"p1",
"s1",
start_time=datetime.datetime(2001, 2, 3, 4, 5, 6, 0),
end_time=datetime.datetime(2001, 2, 3, 4, 5, 7, 0),
)
assert (
repr(job)
== "Job(project=p1, spider=s1, job=None, start_time=2001-02-03 04:05:06, end_time=2001-02-03 04:05:07)"
)

0 comments on commit 0af4c78

Please sign in to comment.