Exemple #1
0
    def test_no_workspace_needed(self):
        """Tests calling JobInterface.validate_connection() without a workspace, but none is needed."""
        job_interface_dict = {
            'command': 'simple-command',
            'command_arguments': '',
            'version': '1.1',
            'input_data': [{
                'name': 'Input 1',
                'type': 'property',
            }, {
                'name': 'Input 2',
                'type': 'file',
                'media_types': ['text/plain'],
                'partial': True
            }],
            'output_data': [],
        }

        job_interface = JobInterface(job_interface_dict)

        job_conn = JobConnection()
        job_conn.add_property('Input 1')
        job_conn.add_input_file('Input 2', False, ['text/plain'], False, True)

        # No exception is success
        job_interface.validate_connection(job_conn)
Exemple #2
0
    def test_successful(self):
        """Tests calling JobInterface.validate_connection() successfully."""
        job_interface_dict = {
            'command': 'simple-command',
            'command_arguments': '',
            'version': '1.0',
            'input_data': [{
                'name': 'Input 1',
                'type': 'property',
            }, {
                'name': 'Input 2',
                'type': 'file',
                'media_types': ['text/plain']
            }],
            'output_data': [{
                'name': 'Output 1',
                'type': 'file',
            }]
        }

        job_interface = JobInterface(job_interface_dict)

        job_conn = JobConnection()
        job_conn.add_property('Input 1')
        job_conn.add_input_file('Input 2', False, ['text/plain'], False, False)
        job_conn.add_workspace()

        # No exception is success
        job_interface.validate_connection(job_conn)
Exemple #3
0
    def test_no_workspace_needed(self):
        '''Tests calling JobInterface.validate_connection() without a workspace, but none is needed.'''
        job_interface_dict = {
            'command': 'simple-command',
            'command_arguments': '',
            'version': '1.0',
            'input_data': [{
                'name': 'Input 1',
                'type': 'property',
            }, {
                'name': 'Input 2',
                'type': 'file',
                'media_types': ['text/plain'],
            }],
            'output_data': [],
        }

        job_interface = JobInterface(job_interface_dict)

        job_conn = JobConnection()
        job_conn.add_property('Input 1')
        job_conn.add_input_file('Input 2', False, ['text/plain'], False)

        # No exception is success
        job_interface.validate_connection(job_conn)
Exemple #4
0
    def test_successful(self):
        """Tests calling JobInterface.validate_connection() successfully."""
        job_interface_dict = {
            'command': 'simple-command',
            'command_arguments': '',
            'version': '1.0',
            'input_data': [{
                'name': 'Input 1',
                'type': 'property',
            }, {
                'name': 'Input 2',
                'type': 'file',
                'media_types': ['text/plain']
            }],
            'output_data': [{
                'name': 'Output 1',
                'type': 'file',
            }]
        }

        job_interface = JobInterface(job_interface_dict)

        job_conn = JobConnection()
        job_conn.add_property('Input 1')
        job_conn.add_input_file('Input 2', False, ['text/plain'], False, False)
        job_conn.add_workspace()

        # No exception is success
        job_interface.validate_connection(job_conn)
Exemple #5
0
    def test_successful(self):
        '''Tests calling JobInterface.validate_connection() successfully.'''
        job_interface_dict = {
            u'command': u'simple-command',
            u'command_arguments': u'',
            u'version': u'1.0',
            u'input_data': [{u'name': u'Input 1', u'type': u'property'},
                            {u'name': u'Input 2', u'type': u'file', u'media_types': [u'text/plain']}],
            u'output_data': [{u'name': u'Output 1', u'type': u'file'}]
        }

        job_interface = JobInterface(job_interface_dict)

        job_conn = JobConnection()
        job_conn.add_property(u'Input 1')
        job_conn.add_input_file(u'Input 2', False, [u'text/plain'], False)
        job_conn.add_workspace()
        
        # No exception is success
        job_interface.validate_connection(job_conn)