def test_load_CWLKERNEL_BOOT_DIRECTORY(self):
        conf = CWLExecuteConfigurator()
        self.assertEqual(conf.CWLKERNEL_BOOT_DIRECTORY, '/tmp/CWLKERNEL_DATA')

        os.environ['CWLKERNEL_BOOT_DIRECTORY'] = '/tmp/CWLKERNEL_DATA1'
        conf = CWLExecuteConfigurator()
        os.environ['CWLKERNEL_BOOT_DIRECTORY'] = '/tmp/CWLKERNEL_DATA'
        self.assertEqual(conf.CWLKERNEL_BOOT_DIRECTORY, '/tmp/CWLKERNEL_DATA1')
    def test_load_CWLKERNEL_MODE(self):
        conf = CWLExecuteConfigurator()
        self.assertEqual(conf.CWLKERNEL_MODE, 'SIMPLE')

        os.environ['CWLKERNEL_MODE'] = 'simple'
        conf = CWLExecuteConfigurator()
        self.assertEqual(conf.CWLKERNEL_MODE, 'simple')

        os.environ['CWLKERNEL_MODE'] = 'something new'
        self.assertRaises(RuntimeError, CWLExecuteConfigurator)
 def test_file_repository(self):
     conf = CWLExecuteConfigurator()
     location = os.sep.join(
         [conf.CWLKERNEL_BOOT_DIRECTORY,
          str(uuid.uuid4()), 'repo'])
     repo = WorkflowRepository(Path(location))
     head_tool: WorkflowComponent = CWLTool(
         'head', {
             'class':
             'CommandLineTool',
             'cwlVersion':
             'v1.0',
             'id':
             'head',
             'baseCommand': ['head'],
             'inputs': [{
                 'id': 'number_of_lines',
                 'type': 'int?',
                 'inputBinding': {
                     'position': 0,
                     'prefix': '-n'
                 }
             }, {
                 'id': 'headinput',
                 'type': 'File',
                 'inputBinding': {
                     'position': 1
                 }
             }],
             'outputs': [{
                 'id': 'headoutput',
                 'type': 'stdout'
             }],
             'label':
             'head',
             'stdout':
             'head.out'
         })
     repo.register_tool(head_tool)
     self.assertEqual(
         os.path.realpath(repo.get_tools_path_by_id('head').absolute()),
         os.path.realpath(os.path.join(location, 'head.cwl')))
 def test_all_properties_have_default_value(self):
     conf = CWLExecuteConfigurator()
     for property in conf.properties:
         self.assertIsNotNone(conf.__getattribute__(property))