当前位置: 首页>>代码示例>>Python>>正文


Python DeliveryNodeFactory.delete方法代码示例

本文整理汇总了Python中eums.test.factories.delivery_node_factory.DeliveryNodeFactory.delete方法的典型用法代码示例。如果您正苦于以下问题:Python DeliveryNodeFactory.delete方法的具体用法?Python DeliveryNodeFactory.delete怎么用?Python DeliveryNodeFactory.delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eums.test.factories.delivery_node_factory.DeliveryNodeFactory的用法示例。


在下文中一共展示了DeliveryNodeFactory.delete方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_should_delete_node_from_elasticsearch_when_deleted

# 需要导入模块: from eums.test.factories.delivery_node_factory import DeliveryNodeFactory [as 别名]
# 或者: from eums.test.factories.delivery_node_factory.DeliveryNodeFactory import delete [as 别名]
    def test_should_delete_node_from_elasticsearch_when_deleted(self):
        node = DeliveryNodeFactory()
        SyncInfo.objects.create(status=SyncInfo.STATUS.SUCCESSFUL)

        node.delete()
        nodes_to_delete = list_nodes_to_delete()

        self.assertIn(node.id, nodes_to_delete)
开发者ID:phoenix-zhu,项目名称:eums,代码行数:10,代码来源:test_sync_data_generators.py

示例2: test_should_update_balance_when_node_quantities_change

# 需要导入模块: from eums.test.factories.delivery_node_factory import DeliveryNodeFactory [as 别名]
# 或者: from eums.test.factories.delivery_node_factory.DeliveryNodeFactory import delete [as 别名]
    def test_should_update_balance_when_node_quantities_change(self):
        node = DeliveryNodeFactory(quantity=100, acknowledged=100)
        child = DeliveryNodeFactory(parents=[(node, 50)])

        self.assertEqual(child.balance, 50)
        self.assertEqual(DeliveryNode.objects.get(id=node.id).balance, 50)

        child_two = DeliveryNodeFactory(parents=[(node, 40)])
        self.assertEqual(child_two.balance, 40)
        self.assertEqual(DeliveryNode.objects.get(id=node.id).balance, 10)

        child_two.delete()
        self.assertEqual(DeliveryNode.objects.get(id=node.id).balance, 50)
开发者ID:v55448330,项目名称:eums,代码行数:15,代码来源:test_delivery_node.py

示例3: test_should_push_deleted_nodes_to_elasticsearch

# 需要导入模块: from eums.test.factories.delivery_node_factory import DeliveryNodeFactory [as 别名]
# 或者: from eums.test.factories.delivery_node_factory.DeliveryNodeFactory import delete [as 别名]
    def test_should_push_deleted_nodes_to_elasticsearch(self, mock_serialise_nodes,
                                                        mock_post, mock_get, mock_converter, *_):
        mock_get.return_value = FakeResponse({}, status_code=HTTP_200_OK)
        node = DeliveryNodeFactory()
        run()
        node.delete()

        api_data = '{}'
        stub_nodes_to_update = {'id': 10}
        mock_serialise_nodes.return_value = stub_nodes_to_update
        mock_converter.return_value = api_data
        mock_post.return_value = FakeResponse({}, status_code=HTTP_200_OK)

        run()

        mock_converter.assert_called_with(stub_nodes_to_update, [node.id])
        mock_post.assert_called_with(settings.ELASTIC_SEARCH.BULK, data=api_data)
        self.assertListEqual(DeleteRecords.objects.first().nodes_to_delete, [])
开发者ID:phoenix-zhu,项目名称:eums,代码行数:20,代码来源:test_synchroniser.py


注:本文中的eums.test.factories.delivery_node_factory.DeliveryNodeFactory.delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。