MCPcopy
hub / github.com/redis/redis-py / test_cluster_pubsub_numsub

Method test_cluster_pubsub_numsub

tests/test_cluster.py:1309–1323  ·  view source on GitHub ↗
(self, r)

Source from the content-addressed store, hash-verified

1307
1308 @skip_if_server_version_lt("2.8.0")
1309 def test_cluster_pubsub_numsub(self, r):
1310 p1 = r.pubsub()
1311 p1.subscribe("foo", "bar", "baz")
1312 for i in range(3):
1313 assert wait_for_message(p1, timeout=0.5)["type"] == "subscribe"
1314 p2 = r.pubsub()
1315 p2.subscribe("bar", "baz")
1316 for i in range(2):
1317 assert wait_for_message(p2, timeout=0.5)["type"] == "subscribe"
1318 p3 = r.pubsub()
1319 p3.subscribe("baz")
1320 assert wait_for_message(p3, timeout=0.5)["type"] == "subscribe"
1321
1322 channels = [(b"foo", 1), (b"bar", 2), (b"baz", 3)]
1323 assert r.pubsub_numsub("foo", "bar", "baz", target_nodes="all") == channels
1324
1325 @skip_if_redis_enterprise()
1326 def test_cluster_myid(self, r):

Callers

nothing calls this directly

Calls 4

wait_for_messageFunction · 0.90
pubsub_numsubMethod · 0.80
pubsubMethod · 0.45
subscribeMethod · 0.45

Tested by

no test coverage detected