diff options
author | Simó Albert i Beltran <sim6@bona.gent> | 2023-02-28 00:03:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-28 06:03:47 +0700 |
commit | ed59b9248aeb87c566661d0f5ee2c2e934c41440 (patch) | |
tree | a4ab091d35a23daf4b4b046be3fab9a1c06ffd74 /tests | |
parent | 1fa6ec1055c5befa0e9c7c5bb74ebaa99eda5883 (diff) | |
download | rq-ed59b9248aeb87c566661d0f5ee2c2e934c41440.tar.gz |
fix: Dependency list in depends_on (#1843)
* test: Dependency list in depends_on
Signed-off-by: Simó Albert i Beltran <sim6@bona.gent>
* fix: Dependency list in depends_on
Signed-off-by: Simó Albert i Beltran <sim6@bona.gent>
---------
Signed-off-by: Simó Albert i Beltran <sim6@bona.gent>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_dependencies.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/test_dependencies.py b/tests/test_dependencies.py index 26b115d..980e805 100644 --- a/tests/test_dependencies.py +++ b/tests/test_dependencies.py @@ -117,6 +117,19 @@ class TestDependencies(RQTestCase): self.assertEqual(q.job_ids, ["fake_job_id_2", "fake_job_id_1"]) + def test_dependency_list_in_depends_on(self): + """Enqueue with Dependency list in depends_on""" + q = Queue(connection=self.testconn) + w = SimpleWorker([q], connection=q.connection) + + # enqueue dependent job when parent successfully finishes + parent_job1 = q.enqueue(say_hello) + parent_job2 = q.enqueue(say_hello) + job = q.enqueue_call(say_hello, depends_on=[Dependency([parent_job1]), Dependency([parent_job2])]) + w.work(burst=True) + self.assertEqual(job.get_status(), JobStatus.FINISHED) + + def test_dependencies_are_met_if_parent_is_canceled(self): """When parent job is canceled, it should be treated as failed""" queue = Queue(connection=self.testconn) |