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)
test_dependency_parsing.py 文件源码
python
阅读 26
收藏 0
点赞 0
评论 0
评论列表
文章目录