本文整理汇总了Python中asynctest.mock.Mock.uid方法的典型用法代码示例。如果您正苦于以下问题:Python Mock.uid方法的具体用法?Python Mock.uid怎么用?Python Mock.uid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类asynctest.mock.Mock
的用法示例。
在下文中一共展示了Mock.uid方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_node_status_member
# 需要导入模块: from asynctest.mock import Mock [as 别名]
# 或者: from asynctest.mock.Mock import uid [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 uid [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())