test_dependency_parsing.py 文件源码

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

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

            output_patch.return_value = MockOutput()
            input_patch.return_value = MockInput(DEPENDENCY_TASK["input"])
            workflow_mock.__get__ = mock.Mock(
                return_value={
                    "dependency_parser": MockParser()
                }
            )

            task = bwg.tasks.dependency_parsing.DependencyParseTask(task_config=task_config)

            # Testing
            self._test_task(task)
            self._test_dependency_parse(task)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号