def test_combine_enum_with_label(self):
        wf = WorkflowGenerator()

        wf.add_input(input1='enum', symbols=['one', 'two', 'three'],
                     label='test label')
        obj = wf.to_obj()['inputs']['input1']
        assert obj['label'] == 'test label'
    def test_convert_symbols_to_list_of_strings(self):
        wf = WorkflowGenerator()

        wf.add_input(input1='enum', symbols=[1, 2, 3])
        obj = wf.to_obj()['inputs']['input1']

        assert obj['type']['symbols'] == ['1', '2', '3']
Example #3
0
    def test_default_value_for_workflow_input(self):
        wf = WorkflowGenerator()

        wf.add_input(input1='string', default='test')
        obj = wf.to_obj()['inputs']['input1']
        assert obj['type'] == 'string'
        assert obj['default'] == 'test'
    def test_enum_as_workflow_input(self):
        wf = WorkflowGenerator()

        wf.add_input(input1='enum', symbols=['one', 'two', 'three'])

        wf.validate()

        obj = wf.to_obj()['inputs']['input1']
        assert obj['type']['type'] == 'enum'
        assert obj['type']['symbols'] == ['one', 'two', 'three']
    def test_label_for_workflow_input(self):
        wf = WorkflowGenerator()

        wf.add_input(input1='string', label='test label')

        wf.validate()

        obj = wf.to_obj()['inputs']['input1']
        assert obj['type'] == 'string'
        assert obj['label'] == 'test label'