Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix redis cumsumer tests [Итоговое задание 2] #29

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions tests/integration/transport/redis/test_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ def test_consumer_group(
redis_consumer_factory: ConsumerFactory,
) -> None:
redis_consumer = redis_consumer_factory._consumer
consumer_group = redis_consumer._consumer_group
assert consumer_group.keys.get(RedisStream.TEST)
with redis_consumer:
consumer_group = redis_consumer._consumer_group
assert consumer_group.keys.get(RedisStream.TEST)

@pytest.mark.parametrize("enable_sentinel", [False, True], indirect=True)
def test_consume_new(
Expand All @@ -25,8 +26,9 @@ def test_consume_new(
run_id: int,
) -> None:
redis_consumer = redis_consumer_factory._consumer
task = TestRunTask(data=TestRunData(test_run_id=run_id))
assert redis_producer.add_task(task)
task_from_consumer = redis_consumer._consume()[-1]
run_id_from_task = task_from_consumer.decoded_message["data"]["test_run_id"]
assert run_id_from_task == run_id
with redis_consumer:
task = TestRunTask(data=TestRunData(test_run_id=run_id))
assert redis_producer.add_task(task)
task_from_consumer = redis_consumer._consume()[-1]
run_id_from_task = task_from_consumer.decoded_message["data"]["test_run_id"]
assert run_id_from_task == run_id
Loading