本文整理汇总了Python中eums.test.factories.delivery_node_factory.DeliveryNodeFactory.get_ip方法的典型用法代码示例。如果您正苦于以下问题:Python DeliveryNodeFactory.get_ip方法的具体用法?Python DeliveryNodeFactory.get_ip怎么用?Python DeliveryNodeFactory.get_ip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eums.test.factories.delivery_node_factory.DeliveryNodeFactory
的用法示例。
在下文中一共展示了DeliveryNodeFactory.get_ip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_should_get_a_nodes_ip_from_the_root_node_of_the_node_delivery
# 需要导入模块: from eums.test.factories.delivery_node_factory import DeliveryNodeFactory [as 别名]
# 或者: from eums.test.factories.delivery_node_factory.DeliveryNodeFactory import get_ip [as 别名]
def test_should_get_a_nodes_ip_from_the_root_node_of_the_node_delivery(self):
delivery = DeliveryFactory()
root_node = DeliveryNodeFactory(distribution_plan=delivery)
self.assertEqual(root_node.get_ip(),
{'id': root_node.id, 'consignee': root_node.consignee, 'location': root_node.location})
intermediary_node = DeliveryNodeFactory(distribution_plan=delivery, parents=[(root_node, 5)])
self.assertEqual(intermediary_node.get_ip(),
{'id': root_node.id, 'consignee': root_node.consignee, 'location': root_node.location})
leaf_node = DeliveryNodeFactory(parents=[(intermediary_node, 3)], distribution_plan=delivery)
self.assertEqual(leaf_node.get_ip(),
{'id': root_node.id, 'consignee': root_node.consignee, 'location': root_node.location})
示例2: test_should_get_a_nodes_ip_from_the_root_node_of_its_first_parent
# 需要导入模块: from eums.test.factories.delivery_node_factory import DeliveryNodeFactory [as 别名]
# 或者: from eums.test.factories.delivery_node_factory.DeliveryNodeFactory import get_ip [as 别名]
def test_should_get_a_nodes_ip_from_the_root_node_of_its_first_parent(self):
root_node = DeliveryNodeFactory()
self.assertEqual(root_node.get_ip(),
{'id': root_node.id, 'consignee': root_node.consignee, 'location': root_node.location})
second_parent = DeliveryNodeFactory()
self.assertEqual(second_parent.get_ip(),
{'id': second_parent.id, 'consignee': second_parent.consignee,
'location': second_parent.location})
first_level_child_node = DeliveryNodeFactory(parents=[(root_node, 2), (second_parent, 3)])
self.assertEqual(first_level_child_node.get_ip(),
{'id': root_node.id, 'consignee': root_node.consignee, 'location': root_node.location})
second_level_child_node = DeliveryNodeFactory(parents=[(first_level_child_node, 2)])
self.assertEqual(second_level_child_node.get_ip(),
{'id': root_node.id, 'consignee': root_node.consignee, 'location': root_node.location})