Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit 6a43554f authored by perl_d's avatar perl_d Committed by wakonig_k
Browse files

fix: update redis mock for changes in bec

parent 95c931af
No related branches found
No related tags found
1 merge request!418fix: update redis mock for changes in bec/816
Pipeline #50341 passed with warnings
......@@ -4,7 +4,6 @@ import time
from unittest import mock
import pytest
import redis
from bec_lib.messages import ScanMessage
from bec_lib.serialization import MsgpackSerialization
......@@ -21,13 +20,13 @@ def bec_dispatcher_w_connector(bec_dispatcher, topics_msg_list, send_msg_event):
time.sleep(0.2)
yield StopIteration
with mock.patch("redis.Redis"):
pubsub = redis.Redis().pubsub()
messages = pubsub_msg_generator()
pubsub.get_message.side_effect = lambda timeout: next(messages)
connector = QtRedisConnector("localhost:1")
bec_dispatcher.client.connector = connector
yield bec_dispatcher
redis_class_mock = mock.MagicMock()
pubsub = redis_class_mock().pubsub()
messages = pubsub_msg_generator()
pubsub.get_message.side_effect = lambda timeout: next(messages)
connector = QtRedisConnector("localhost:1", redis_class_mock)
bec_dispatcher.client.connector = connector
yield bec_dispatcher
dummy_msg = MsgpackSerialization.dumps(ScanMessage(point_id=0, scan_id="0", data={}))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment