We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b99fe3 commit 7d7bc95Copy full SHA for 7d7bc95
1 file changed
tests/e2e/redis_client.py
@@ -0,0 +1,18 @@
1
+import json
2
+import redis
3
+
4
+from allocation import config
5
6
+r = redis.Redis(**config.get_redis_host_and_port())
7
8
9
+def subscribe_to(channel):
10
+ pubsub = r.pubsub()
11
+ pubsub.subscribe(channel)
12
+ confirmation = pubsub.get_message(timeout=3)
13
+ assert confirmation["type"] == "subscribe"
14
+ return pubsub
15
16
17
+def publish_message(channel, message):
18
+ r.publish(channel, json.dumps(message))
0 commit comments