예제 #1
0
    def test_get_settings_loads_config_file_for_caas_correctly(self, monkeypatch):
        with monkeypatch.context() as ctx:
            ctx.setenv(
                'caas_key', 'encrypted_key_content_string_to_communicate_with_caas'
            )

            loaded_settings = settings.get_settings(
                '{0}{1}'.format(self.data_dir, self.caas_config)
            )
            assert loaded_settings[
                'cromwell_url'
            ] == self.expected_settings_dic_caas.get('cromwell_url')
            assert loaded_settings['use_caas'] == self.expected_settings_dic_caas.get(
                'use_caas'
            )
            assert (
                loaded_settings['caas_key']
                == 'encrypted_key_content_string_to_communicate_with_caas'
            )
            assert loaded_settings[
                'collection_name'
            ] == self.expected_settings_dic_caas.get('collection_name')
            assert loaded_settings['queue_update_interval'] == int(
                self.expected_settings_dic_caas.get('queue_update_interval')
            )
            assert loaded_settings['workflow_start_interval'] == int(
                self.expected_settings_dic_caas.get('workflow_start_interval')
            )
예제 #2
0
 def __init__(self, config_path):
     self.workflow_queue = self.create_empty_queue(
         -1)  # use infinite for the size of the queue for now
     self.thread = None
     self.settings = settings.get_settings(config_path)
     self.cromwell_auth = settings.get_cromwell_auth(self.settings)
     self.queue_update_interval = self.settings.get("queue_update_interval")
     self.cromwell_query_dict = self.settings.get("cromwell_query_dict")
예제 #3
0
    def __init__(self, config_path):
        """Concrete Igniter class for igniting/starting workflows in Cromwell.

        Args:
            config_path (str): Path to the config.json file.
        """
        self.thread = None
        self.settings = settings.get_settings(config_path)
        self.cromwell_auth = settings.get_cromwell_auth(self.settings)
        self.workflow_start_interval = self.settings.get(
            'workflow_start_interval')
예제 #4
0
    def test_get_settings_loads_config_file_for_caas_for_capital_env_variable_correctly(
        self, monkeypatch
    ):
        with monkeypatch.context() as ctx:
            ctx.setenv(
                'CAAS_KEY', 'encrypted_key_content_string_to_communicate_with_caas'
            )

            loaded_settings = settings.get_settings(
                '{0}{1}'.format(self.data_dir, self.caas_config)
            )
            assert (
                loaded_settings['caas_key']
                == 'encrypted_key_content_string_to_communicate_with_caas'
            )
예제 #5
0
 def test_get_settings_loads_config_file_for_cromwell_instance_correctly(self):
     loaded_settings = settings.get_settings(
         '{0}{1}'.format(self.data_dir, self.cromwell_config)
     )
     assert loaded_settings[
         'cromwell_url'
     ] == self.expected_settings_dic_cromwell_instance.get('cromwell_url')
     assert loaded_settings[
         'use_caas'
     ] == self.expected_settings_dic_cromwell_instance.get('use_caas')
     assert loaded_settings[
         'cromwell_user'
     ] == self.expected_settings_dic_cromwell_instance.get('cromwell_user')
     assert loaded_settings[
         'cromwell_password'
     ] == self.expected_settings_dic_cromwell_instance.get('cromwell_password')
     assert loaded_settings['queue_update_interval'] == int(
         self.expected_settings_dic_cromwell_instance.get('queue_update_interval')
     )
     assert loaded_settings['workflow_start_interval'] == int(
         self.expected_settings_dic_cromwell_instance.get('workflow_start_interval')
     )
예제 #6
0
 def test_get_settings_loads_config_file_for_caas_throw_exceptions_without_caas_key(
     self
 ):
     with pytest.raises(ValueError):
         settings.get_settings('{0}{1}'.format(self.data_dir, self.caas_config))
예제 #7
0
 def test_get_settings_cromwell_query_dict_includes_on_hold_status(self):
     loaded_settings = settings.get_settings(
         '{0}{1}'.format(self.data_dir, self.cromwell_config)
     )
     assert loaded_settings['cromwell_query_dict']['status'] == 'On Hold'
예제 #8
0
 def test_get_settings_loads_config_file_for_cromwell_instance_without_exceptions(
     self
 ):
     settings.get_settings('{0}{1}'.format(self.data_dir, self.cromwell_config))