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


Python ServiceMock.execute方法代碼示例

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


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

示例1: test_GetSingleChunkMultipleTimesAfterWaiting

# 需要導入模塊: from cocaine.testing.mocks import ServiceMock [as 別名]
# 或者: from cocaine.testing.mocks.ServiceMock import execute [as 別名]
 def test_GetSingleChunkMultipleTimesAfterWaiting(self):
     s = ServiceMock(chunks=[1], T=self.T, ioLoop=self.io_loop)
     f1 = s.execute()
     f1.wait()
     f1.get()
     f2 = s.execute()
     f2.wait()
     r2 = f2.get()
     self.assertEqual(1, r2)
開發者ID:nexusriot,項目名稱:cocaine-framework-python,代碼行數:11,代碼來源:test_api.py

示例2: test_GetMultipleChunksMultipleTimes

# 需要導入模塊: from cocaine.testing.mocks import ServiceMock [as 別名]
# 或者: from cocaine.testing.mocks.ServiceMock import execute [as 別名]
    def test_GetMultipleChunksMultipleTimes(self):
        s = ServiceMock(chunks=[1, 2, 3], T=self.T, ioLoop=self.io_loop)
        f1 = s.execute()
        f1.get()
        f1.get()
        f1.get()

        f2 = s.execute()
        r21 = f2.get()
        r22 = f2.get()
        r23 = f2.get()
        self.assertEqual(1, r21)
        self.assertEqual(2, r22)
        self.assertEqual(3, r23)
開發者ID:nexusriot,項目名稱:cocaine-framework-python,代碼行數:16,代碼來源:test_api.py

示例3: test_GetSingleChunkMultipleTimes

# 需要導入模塊: from cocaine.testing.mocks import ServiceMock [as 別名]
# 或者: from cocaine.testing.mocks.ServiceMock import execute [as 別名]
 def test_GetSingleChunkMultipleTimes(self):
     s = ServiceMock(chunks=[1], T=self.T, ioLoop=self.io_loop)
     s.execute().get()
     r2 = s.execute().get()
     self.assertEqual(1, r2)
開發者ID:nexusriot,項目名稱:cocaine-framework-python,代碼行數:7,代碼來源:test_api.py


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