本文整理汇总了Python中system_test.main_module函数的典型用法代码示例。如果您正苦于以下问题:Python main_module函数的具体用法?Python main_module怎么用?Python main_module使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了main_module函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_connection_opened
def on_connection_opened(self, event):
if event.connection == self.conn_route:
self.conn_normal = event.container.connect(self.normal_addr)
elif event.connection == self.conn_normal:
self.sender = event.container.create_sender(self.conn_normal, self.dest)
def on_connection_closed(self, event):
self.conn_route.close()
self.timer.cancel()
def on_link_opened(self, event):
if event.receiver:
self.receiver = event.receiver
self.receiver.flow(1)
def on_sendable(self, event):
msg = Message(body="CloseWithUnsettled")
event.sender.send(msg)
def on_message(self, event):
self.conn_normal.close()
def run(self):
Container(self).run()
if __name__ == '__main__':
unittest.main(main_module())
示例2: dict
self.assertRaises(
BadRequestStatus,
self.node.create, dict(attrs, type=CONNECTOR, name="bad2", port=str(self.get_port())))
conf = Qdrouterd.Config([
('router', { 'mode': 'standalone', 'id': 'all_by_myself1'}),
('listener', {'port':self.get_port(), 'role':'inter-router'})
])
r = self.qdrouterd('routerX', conf, wait=False)
r.expect = Process.EXIT_FAIL
self.assertTrue(r.wait() != 0)
conf = Qdrouterd.Config([
('router', { 'mode': 'standalone', 'id': 'all_by_myself2'}),
('listener', {'port':self.get_port(), 'role':'normal'}),
('connector', {'port':self.get_port(), 'role':'inter-router'})
])
r = self.qdrouterd('routerY', conf, wait=False)
r.expect = Process.EXIT_FAIL
self.assertTrue(r.wait() != 0)
def test_get_schema(self):
schema = dictify(QdSchema().dump())
got = self.node.call(self.node.request(operation="GET-JSON-SCHEMA", identity="self")).body
self.assertEquals(schema, dictify(json.loads(got)))
got = self.node.call(self.node.request(operation="GET-SCHEMA", identity="self")).body
self.assertEquals(schema, got)
if __name__ == '__main__':
unittest.main(system_test.main_module())