當前位置: 首頁>>代碼示例>>Python>>正文


Python StompCLI.onecmd方法代碼示例

本文整理匯總了Python中stomp.__main__.StompCLI.onecmd方法的典型用法代碼示例。如果您正苦於以下問題:Python StompCLI.onecmd方法的具體用法?Python StompCLI.onecmd怎麽用?Python StompCLI.onecmd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在stomp.__main__.StompCLI的用法示例。


在下文中一共展示了StompCLI.onecmd方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: testsendfile

# 需要導入模塊: from stomp.__main__ import StompCLI [as 別名]
# 或者: from stomp.__main__.StompCLI import onecmd [as 別名]
    def testsendfile(self):
        stdin = TestStdin()
        stdout = TestStdout(self)
        stdout.expect('CONNECTED')
        
        cli = StompCLI(host, port, username, password, '1.0', stdin, stdout)

        time.sleep(3)

        cli.onecmd('sendfile /queue/testsendfile stomp/test/test.txt')

        time.sleep(3)

        cli.onecmd('quit')
開發者ID:rafaduran,項目名稱:stomp.py,代碼行數:16,代碼來源:cli_test.py

示例2: testrun

# 需要導入模塊: from stomp.__main__ import StompCLI [as 別名]
# 或者: from stomp.__main__.StompCLI import onecmd [as 別名]
    def testrun(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.onecmd('run stomp/test/test.txt')      
        cli.onecmd('quit')
開發者ID:rafaduran,項目名稱:stomp.py,代碼行數:17,代碼來源:cli_test.py

示例3: testsendrec

# 需要導入模塊: from stomp.__main__ import StompCLI [as 別名]
# 或者: from stomp.__main__.StompCLI import onecmd [as 別名]
    def testsendrec(self):
        stdin = TestStdin()
        stdout = TestStdout(self)
        
        stdout.expect('CONNECTED')
        
        cli = StompCLI(host, port, username, password, '1.0', stdin, stdout)

        time.sleep(3)

        stdout.expect('RECEIPT')
        cli.onecmd('sendrec /queue/testsendrec this is a test')

        time.sleep(3)

        cli.onecmd('quit')
開發者ID:rafaduran,項目名稱:stomp.py,代碼行數:18,代碼來源:cli_test.py

示例4: testsendfile

# 需要導入模塊: from stomp.__main__ import StompCLI [as 別名]
# 或者: from stomp.__main__.StompCLI import onecmd [as 別名]
    def testsendfile(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)

        cli.onecmd('sendfile /queue/testsendfile %s' % f.name)

        time.sleep(3)

        teststdout.expect('Shutting down, please wait')
        cli.onecmd('quit')
開發者ID:GeneralizedLearningUtilities,項目名稱:SuperGLU,代碼行數:19,代碼來源:cli_test.py

示例5: testrun

# 需要導入模塊: from stomp.__main__ import StompCLI [as 別名]
# 或者: from stomp.__main__.StompCLI import onecmd [as 別名]
    def testrun(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.onecmd('run %s' % f.name)
        teststdout.expect('Shutting down, please wait')
        cli.onecmd('quit')
開發者ID:GeneralizedLearningUtilities,項目名稱:SuperGLU,代碼行數:20,代碼來源:cli_test.py

示例6: testsubscribe

# 需要導入模塊: from stomp.__main__ import StompCLI [as 別名]
# 或者: from stomp.__main__.StompCLI import onecmd [as 別名]
 def testsubscribe(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/testsubscribe" with acknowledge set to "auto", id set to "1"')
     cli.onecmd('subscribe /queue/testsubscribe')
     stdout.expect('MESSAGE')
     stdout.expect('this is a test')
     cli.onecmd('send /queue/testsubscribe this is a test')
     
     time.sleep(3)
     
     stdout.expect('Unsubscribing from "/queue/testsubscribe"')
     cli.onecmd('unsubscribe /queue/testsubscribe')      
     cli.onecmd('quit')
開發者ID:artilect,項目名稱:stomp.py,代碼行數:22,代碼來源:cli_test.py

示例7: testssl

# 需要導入模塊: from stomp.__main__ import StompCLI [as 別名]
# 或者: from stomp.__main__.StompCLI import onecmd [as 別名]
    def testssl(self):
        teststdin = TestStdin()
        teststdout = TestStdout(self)
        teststdout.expect('CONNECTED')

        cli = StompCLI(sslhost, sslport, username, password, '1.0', use_ssl=True, stdin=teststdin, stdout=teststdout)

        time.sleep(3)

        teststdout.expect('Subscribing to "/queue/testsubscribe" with acknowledge set to "auto", id set to "1"')
        cli.onecmd('subscribe /queue/testsubscribe')
        teststdout.expect('MESSAGE')
        teststdout.expect('this is a test')
        cli.onecmd('send /queue/testsubscribe this is a test')

        time.sleep(3)

        teststdout.expect('Unsubscribing from "/queue/testsubscribe"')
        cli.onecmd('unsubscribe /queue/testsubscribe')
        teststdout.expect('Shutting down, please wait')
        cli.onecmd('quit')
開發者ID:GeneralizedLearningUtilities,項目名稱:SuperGLU,代碼行數:23,代碼來源:cli_ssl_test.py

示例8: teststats

# 需要導入模塊: from stomp.__main__ import StompCLI [as 別名]
# 或者: from stomp.__main__.StompCLI import onecmd [as 別名]
    def teststats(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/teststats" with acknowledge set to "auto", id set to "1"')
        cli.onecmd('subscribe /queue/teststats')
        
        stdout.expect('.*No stats available.*')
        cli.onecmd('stats')
        
        time.sleep(1)
        
        cli.onecmd('stats on')
        cli.onecmd('send /queue/teststats this is a test')

        stdout.expect('MESSAGE')
        stdout.expect('this is a test')

        time.sleep(3)
        
        cli.onecmd('stats')

        stdout.expect('Unsubscribing from "/queue/teststats"')
        cli.onecmd('unsubscribe /queue/teststats')
        cli.onecmd('quit')
開發者ID:rafaduran,項目名稱:stomp.py,代碼行數:32,代碼來源:cli_test.py

示例9: testabort

# 需要導入模塊: from stomp.__main__ import StompCLI [as 別名]
# 或者: from stomp.__main__.StompCLI import onecmd [as 別名]
    def testabort(self):
        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/testabort" with acknowledge set to "auto", id set to "1"')
        cli.onecmd('subscribe /queue/testabort')

        cli.onecmd('begin')
        cli.onecmd('send /queue/testabort this is a test')
        cli.onecmd('abort')

        time.sleep(3)

        teststdout.expect('Unsubscribing from "/queue/testabort"')
        cli.onecmd('unsubscribe /queue/testabort')
        teststdout.expect('Shutting down, please wait')
        cli.onecmd('quit')
開發者ID:GeneralizedLearningUtilities,項目名稱:SuperGLU,代碼行數:24,代碼來源:cli_test.py


注:本文中的stomp.__main__.StompCLI.onecmd方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。