test(jobs): test out setting ttl
continuous-integration/drone/push Build is failing Details

pull/62/head
Houkime 2023-09-22 18:13:22 +00:00 committed by Inex Code
parent 26c0a8fafe
commit ece3258c78
1 changed files with 9 additions and 0 deletions

View File

@ -1,6 +1,7 @@
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
import pytest
from time import sleep
from selfprivacy_api.jobs import Jobs, JobStatus
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() == []
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):
jobs = jobs_with_one_job
test_job = jobs_with_one_job.get_jobs()[0]