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


Python crawling.RPCFindResponse類代碼示例

本文整理匯總了Python中dht.crawling.RPCFindResponse的典型用法代碼示例。如果您正苦於以下問題:Python RPCFindResponse類的具體用法?Python RPCFindResponse怎麽用?Python RPCFindResponse使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: test_happened

 def test_happened(self):
     response = (True, ("value", "some_value"))
     r = RPCFindResponse(response)
     self.assertTrue(r.happened())
     response = (False, ("value", "some_value"))
     r = RPCFindResponse(response)
     self.assertFalse(r.happened())
開發者ID:fivemil,項目名稱:PulseShop-Server,代碼行數:7,代碼來源:test_crawling.py

示例2: test_hasValue

 def test_hasValue(self):
     response = (True, ("value", "some_value"))
     r = RPCFindResponse(response)
     self.assertTrue(r.hasValue())
     response = (False, "a node")
     r = RPCFindResponse(response)
     self.assertFalse(r.hasValue())
開發者ID:fivemil,項目名稱:PulseShop-Server,代碼行數:7,代碼來源:test_crawling.py

示例3: test_getNodeList

 def test_getNodeList(self):
     node1 = Node(digest("id1"), "127.0.0.1", 12345, signed_pubkey=digest("key1"), vendor=True)
     node2 = Node(digest("id2"), "127.0.0.1", 22222, signed_pubkey=digest("key2"), vendor=True)
     node3 = Node(digest("id3"), "127.0.0.1", 77777, signed_pubkey=digest("key3"))
     response = (True, (node1.getProto().SerializeToString(), node2.getProto().SerializeToString(), node3.getProto().SerializeToString(),
         "sdfasdfsd"))
     r = RPCFindResponse(response)
     nodes = r.getNodeList()
     self.assertEqual(nodes[0].getProto(), node1.getProto())
     self.assertEqual(nodes[1].getProto(), node2.getProto())
     self.assertEqual(nodes[2].getProto(), node3.getProto())
開發者ID:Renelvon,項目名稱:Network,代碼行數:11,代碼來源:test_crawling.py

示例4: test_getNodeList

 def test_getNodeList(self):
     node1 = Node(digest("id1"), "127.0.0.1", 1234, digest("key1"), None, FULL_CONE, True)
     node2 = Node(digest("id2"), "248.130.11.21", 1111, digest("key2"), None, FULL_CONE, True)
     node3 = Node(digest("id3"), "987.567.23.1", 23456, digest("key3"), None, FULL_CONE, False)
     response = (True, (node1.getProto().SerializeToString(), node2.getProto().SerializeToString(),
                        node3.getProto().SerializeToString(),
                        "sdfasdfsd"))
     r = RPCFindResponse(response)
     nodes = r.getNodeList()
     self.assertEqual(nodes[0].getProto(), node1.getProto())
     self.assertEqual(nodes[1].getProto(), node2.getProto())
     self.assertEqual(nodes[2].getProto(), node3.getProto())
開發者ID:fivemil,項目名稱:PulseShop-Server,代碼行數:12,代碼來源:test_crawling.py

示例5: test_getValue

 def test_getValue(self):
     response = (True, ("value", "some_value"))
     r = RPCFindResponse(response)
     self.assertEqual(r.getValue(), ("some_value",))
開發者ID:fivemil,項目名稱:PulseShop-Server,代碼行數:4,代碼來源:test_crawling.py


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