本文整理匯總了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')