Remove extra colon in dependencies key

This seems like a bug, but if I'm mistaken please let me know.
This commit is contained in:
Ethan Wolinsky 2023-05-08 22:21:32 -04:00
parent b03413e9eb
commit 5ebf7a3500
2 changed files with 2 additions and 2 deletions

View File

@ -716,7 +716,7 @@ class Job:
@property
def dependencies_key(self):
return '{0}:{1}:dependencies'.format(self.redis_job_namespace_prefix, self.id)
return '{0}{1}:dependencies'.format(self.redis_job_namespace_prefix, self.id)
def fetch_dependencies(self, watch: bool = False, pipeline: Optional['Pipeline'] = None) -> List['Job']:
"""Fetch all of a job's dependencies. If a pipeline is supplied, and

View File

@ -994,7 +994,7 @@ class TestJob(RQTestCase):
def test_dependencies_key_should_have_prefixed_job_id(self):
job_id = 'random'
job = Job(id=job_id)
expected_key = Job.redis_job_namespace_prefix + ":" + job_id + ':dependencies'
expected_key = Job.redis_job_namespace_prefix + job_id + ':dependencies'
assert job.dependencies_key == expected_key