diff options
author | f0cker <f0cker@users.noreply.github.com> | 2021-01-19 01:19:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 08:19:31 +0700 |
commit | efe703214e1015db53d4942398435a8c597d7a2d (patch) | |
tree | 111c2f7c6d356373aecdd9786ee03560d8beeafe /tests/test_cli.py | |
parent | 11c8631921cd9738b94c17937315ec9dba0041b7 (diff) | |
download | rq-efe703214e1015db53d4942398435a8c597d7a2d.tar.gz |
Added --serializer option to cli, finishing off PR #1381 and fix #1357 (#1395)
* Added --serializer option to cli, finishing off PR #1381 and fix #1357
* Update documentation
* Update documentation
* Modified help message
Co-authored-by: f0cker <dturner@trustwave.com>
Diffstat (limited to 'tests/test_cli.py')
-rw-r--r-- | tests/test_cli.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_cli.py b/tests/test_cli.py index 51d4e60..8c5aa62 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -12,6 +12,7 @@ from rq.cli import main from rq.cli.helpers import read_config_file, CliConfig from rq.job import Job from rq.registry import FailedJobRegistry, ScheduledJobRegistry +from rq.serializers import JSONSerializer from rq.worker import Worker, WorkerStatus import pytest @@ -346,3 +347,13 @@ class TestRQCli(RQTestCase): self.assertEqual(result.exit_code, 1) self.assertIn("Duration must be an integer greater than 1", result.output) + + def test_serializer(self): + """rq worker -u <url> --serializer <serializer>""" + connection = Redis.from_url(self.redis_url) + q = Queue('default', connection=connection, serializer=JSONSerializer) + runner = CliRunner() + job = q.enqueue(say_hello) + runner.invoke(main, ['worker', '-u', self.redis_url, + '--serializer rq.serializer.JSONSerializer']) + self.assertIn(job.id, q.job_ids) |