本文整理汇总了Python中stomp.__main__.StompCLI.do_run方法的典型用法代码示例。如果您正苦于以下问题:Python StompCLI.do_run方法的具体用法?Python StompCLI.do_run怎么用?Python StompCLI.do_run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stomp.__main__.StompCLI
的用法示例。
在下文中一共展示了StompCLI.do_run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testrunarg
# 需要导入模块: from stomp.__main__ import StompCLI [as 别名]
# 或者: from stomp.__main__.StompCLI import do_run [as 别名]
def testrunarg(self):
stdin = TestStdin()
stdout = TestStdout(self)
stdout.expect('CONNECTED')
cli = StompCLI(host, port, username, password, '1.0', stdin, stdout)
time.sleep(3)
stdout.expect('Subscribing to "/queue/testfile" with acknowledge set to "auto", id set to "1"')
stdout.expect('this is a test')
stdout.expect('MESSAGE')
stdout.expect('Unsubscribing from "/queue/testfile"')
cli.do_run('stomp/test/test.txt')
示例2: testrunarg
# 需要导入模块: from stomp.__main__ import StompCLI [as 别名]
# 或者: from stomp.__main__.StompCLI import do_run [as 别名]
def testrunarg(self):
f = create_test_file()
teststdin = TestStdin()
teststdout = TestStdout(self)
teststdout.expect('CONNECTED')
cli = StompCLI(host, port, username, password, '1.0', stdin=teststdin, stdout=teststdout)
time.sleep(3)
teststdout.expect('Subscribing to "/queue/testfile" with acknowledge set to "auto", id set to "1"')
teststdout.expect('this is a test')
teststdout.expect('MESSAGE')
teststdout.expect('Unsubscribing from "/queue/testfile"')
cli.do_run(f.name)
teststdout.expect('Shutting down, please wait')
cli.onecmd('quit')