From 9465b6408dc99bf5d16b9cb4050ceb4e439964fa Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Sat, 1 May 2021 15:53:43 -0400 Subject: [PATCH] Test and workflow for new `get_irb_info` script --- .../data/irb_info_script/irb_info_script.bpmn | 52 +++++++++++++++++++ tests/test_irb_info_script.py | 16 ++++++ 2 files changed, 68 insertions(+) create mode 100644 tests/data/irb_info_script/irb_info_script.bpmn create mode 100644 tests/test_irb_info_script.py diff --git a/tests/data/irb_info_script/irb_info_script.bpmn b/tests/data/irb_info_script/irb_info_script.bpmn new file mode 100644 index 00000000..9ba223eb --- /dev/null +++ b/tests/data/irb_info_script/irb_info_script.bpmn @@ -0,0 +1,52 @@ + + + + + SequenceFlow_0xey0zw + + + + SequenceFlow_0xey0zw + SequenceFlow_03hympo + irb_info = get_irb_info() + + + + SequenceFlow_1s6cthx + + + + IRB Info: {{irb_info}} + SequenceFlow_03hympo + SequenceFlow_1s6cthx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/test_irb_info_script.py b/tests/test_irb_info_script.py new file mode 100644 index 00000000..c7e62626 --- /dev/null +++ b/tests/test_irb_info_script.py @@ -0,0 +1,16 @@ +from tests.base_test import BaseTest +from crc.services.protocol_builder import ProtocolBuilderService + +from crc import app, session + + +class TestIRBInfo(BaseTest): + + def test_irb_info_script(self): + app.config['PB_ENABLED'] = True + workflow = self.create_workflow('irb_info_script') + irb_info = ProtocolBuilderService.get_irb_info(workflow.study_id) + workflow_api = self.get_workflow_api(workflow) + first_task = workflow_api.next_task + self.assertEqual('Task_PrintInfo', first_task.name) + self.assertEqual(f'IRB Info: {irb_info}', first_task.documentation)