本文整理匯總了Python中pypeman.channels.BaseChannel.append方法的典型用法代碼示例。如果您正苦於以下問題:Python BaseChannel.append方法的具體用法?Python BaseChannel.append怎麽用?Python BaseChannel.append使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pypeman.channels.BaseChannel
的用法示例。
在下文中一共展示了BaseChannel.append方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_sub_channel
# 需要導入模塊: from pypeman.channels import BaseChannel [as 別名]
# 或者: from pypeman.channels.BaseChannel import append [as 別名]
def test_sub_channel(self):
""" Whether Sub Channel is working """
chan = BaseChannel(name="test_channel3", loop=self.loop)
n1 = TestNode(name="main")
n2 = TestNode(name="sub")
n3 = TestNode(name="sub1")
n4 = TestNode(name="sub2")
msg = generate_msg()
same_chan = chan.append(n1)
self.assertEqual(chan, same_chan, "Append don't return channel.")
sub = chan.fork(name="subchannel")
sub.append(n2, n3, n4)
# Launch channel processing
self.start_channels()
self.loop.run_until_complete(chan.handle(msg))
self.assertTrue(n2.processed, "Sub Channel not working")
self.assertTrue(n3.processed, "Sub Channel not working")
self.assertTrue(n4.processed, "Sub Channel not working")
self.assertEqual(sub.name, "test_channel3.subchannel", "Subchannel name is incorrect")