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)
评论列表
文章目录