本文整理匯總了Python中asynctest.mock.Mock.pubkey方法的典型用法代碼示例。如果您正苦於以下問題:Python Mock.pubkey方法的具體用法?Python Mock.pubkey怎麽用?Python Mock.pubkey使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類asynctest.mock.Mock
的用法示例。
在下文中一共展示了Mock.pubkey方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_node_status_member
# 需要導入模塊: from asynctest.mock import Mock [as 別名]
# 或者: from asynctest.mock.Mock import pubkey [as 別名]
def test_node_status_member(self, app, community):
community.parameters = CoroutineMock(return_value = {'sigValidity': 1000})
base_graph = BaseGraph(app, community)
certifier = Mock(specs='core.registry.Identity')
certifier.pubkey = "7Aqw6Efa9EzE7gtsc8SveLLrM7gm6NEGoywSv4FJx6pZ"
certifier.uid = "first_identity"
certifier.is_member = CoroutineMock(spec='core.registry.Identity.is_member', return_value=False)
account_identity = Mock(specs='core.registry.Identity')
account_identity.pubkey = "FADxcH5LmXGmGFgdixSes6nWnC4Vb4pRUBYT81zQRhjn"
account_identity.uid = "second_uid"
account_identity.is_member = CoroutineMock(spec='core.registry.Identity.is_member', return_value=True)
async def exec_test():
self.assertEquals((await base_graph.node_status(certifier, account_identity)), NodeStatus.OUT)
self.assertEquals((await base_graph.node_status(account_identity, account_identity)), NodeStatus.HIGHLIGHTED)
self.lp.run_until_complete(exec_test())
示例2: test_explore_to_find_unknown
# 需要導入模塊: from asynctest.mock import Mock [as 別名]
# 或者: from asynctest.mock.Mock import pubkey [as 別名]
def test_explore_to_find_unknown(self, app, community):
community.parameters = CoroutineMock(return_value = {'sigValidity': 1000})
community.network.confirmations = Mock(side_effect=lambda n: 4 if 996 else None)
app.preferences = {'expert_mode': True}
wot_graph = WoTGraph(app, community)
identity_unknown = Mock(specs='core.registry.Identity')
identity_unknown.pubkey = "8Fi1VSTbjkXguwThF4v2ZxC5whK7pwG2vcGTkPUPjPGU"
identity_unknown.uid = "unkwn"
async def exec_test():
result = await wot_graph.explore_to_find_member(self.account_identity, identity_unknown)
self.assertFalse(result)
self.assertEqual(len(wot_graph.nx_graph.nodes()), 3)
self.assertEqual(len(wot_graph.nx_graph.edges()), 2)
self.lp.run_until_complete(exec_test())