MCPcopy
hub / github.com/pathwaycom/pathway / test_subscribe

Function test_subscribe

python/pathway/tests/test_io.py:612–638  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

610
611
612def test_subscribe():
613 class TestSubject(pw.io.python.ConnectorSubject):
614 def run(self):
615 self.next(data="foo")
616
617 table = pw.io.python.read(TestSubject(), format="raw")
618
619 root = mock.Mock()
620
621 pw.io.subscribe(
622 table,
623 on_change=root.on_change,
624 on_time_end=root.on_time_end,
625 on_end=root.on_end,
626 )
627
628 run()
629
630 root.assert_has_calls(
631 [
632 mock.call.on_change(
633 key=mock.ANY, row={"data": "foo"}, time=mock.ANY, is_addition=True
634 ),
635 mock.call.on_time_end(mock.ANY),
636 mock.call.on_end(),
637 ]
638 )
639
640
641def test_python_write():

Callers

nothing calls this directly

Calls 6

runFunction · 0.90
subscribeMethod · 0.80
TestSubjectClass · 0.70
on_changeMethod · 0.45
on_time_endMethod · 0.45
on_endMethod · 0.45

Tested by

no test coverage detected