test_relation_merging.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:bigworldgraph 作者: majdigital 项目源码 文件源码
def test_task_functions(self, input_patch, output_patch):
        with mock.patch(
            "bwg.tasks.relation_merging.RelationMergingTask.workflow_resources", new_callable=mock.PropertyMock()
        ) as workflow_mock:
            task_config = {
                "CORPUS_ENCODING": "",
                "RELATION_MERGING_OUTPUT_PATH": ""
            }

            output_patch.return_value = MockOutput()
            input_patch.return_value = (
                MockInput(RELATION_MERGING_TASK["input"][0]),
                MockInput(RELATION_MERGING_TASK["input"][0])
            )
            workflow_mock.__get__ = mock.Mock(return_value={})

            task = bwg.tasks.relation_merging.RelationMergingTask(task_config=task_config)

            # Testing
            self._test_get_relations_from_sentence_json()
            self._test_is_relevant_article(task)
            self._test_is_relevant_sentence(task)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号