MCPcopy Create free account
hub / github.com/YuminosukeSato/ironkernel / test_select_receives

Method test_select_receives

tests/python/test_channel.py:24–30  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

22
23class TestSelect:
24 def test_select_receives(self) -> None:
25 ch_a = rt.chan(10)
26 ch_b = rt.chan(10)
27 ch_a.send(rt.asarray(np.array([42.0])))
28 idx, val = select(RecvCase(ch_a), RecvCase(ch_b), default=True)
29 assert idx == 0
30 assert val.numpy()[0] == 42.0
31
32 def test_select_default(self) -> None:
33 ch_a = rt.chan(10)

Callers

nothing calls this directly

Calls 4

numpyMethod · 0.80
chanMethod · 0.45
sendMethod · 0.45
asarrayMethod · 0.45

Tested by

no test coverage detected