mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-22 04:01:27 +00:00
test(jobs): test out setting ttl
This commit is contained in:
parent
26c0a8fafe
commit
ece3258c78
|
@ -1,6 +1,7 @@
|
||||||
# pylint: disable=redefined-outer-name
|
# pylint: disable=redefined-outer-name
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
import pytest
|
import pytest
|
||||||
|
from time import sleep
|
||||||
|
|
||||||
from selfprivacy_api.jobs import Jobs, JobStatus
|
from selfprivacy_api.jobs import Jobs, JobStatus
|
||||||
import selfprivacy_api.jobs as jobsmodule
|
import selfprivacy_api.jobs as jobsmodule
|
||||||
|
@ -55,6 +56,14 @@ def test_set_zeroing_ttl(jobs_with_one_job):
|
||||||
assert jobs_with_one_job.get_jobs() == []
|
assert jobs_with_one_job.get_jobs() == []
|
||||||
|
|
||||||
|
|
||||||
|
def test_not_zeroing_ttl(jobs_with_one_job):
|
||||||
|
test_job = jobs_with_one_job.get_jobs()[0]
|
||||||
|
jobs_with_one_job.set_expiration(test_job, 1)
|
||||||
|
assert len(jobs_with_one_job.get_jobs()) == 1
|
||||||
|
sleep(1.2)
|
||||||
|
assert len(jobs_with_one_job.get_jobs()) == 0
|
||||||
|
|
||||||
|
|
||||||
def test_jobs(jobs_with_one_job):
|
def test_jobs(jobs_with_one_job):
|
||||||
jobs = jobs_with_one_job
|
jobs = jobs_with_one_job
|
||||||
test_job = jobs_with_one_job.get_jobs()[0]
|
test_job = jobs_with_one_job.get_jobs()[0]
|
||||||
|
|
Loading…
Reference in a new issue