<s> from galaxy . util . bunch import Bunch <EOL> from pulsar . client . action_mapper import ( <EOL> FileActionMapper , <EOL> ) <EOL> def test_endpoint_validation ( ) : <EOL> client = _min_client ( "<STR_LIT>" ) <EOL> mapper = FileActionMapper ( client ) <EOL> exception_found = False <EOL> try : <EOL> mapper . action ( '<STR_LIT>' , '<STR_LIT:input>' ) <EOL> except Exception as e : <EOL> exception_found = True <EOL> assert "<STR_LIT>" in str ( e ) <EOL> assert exception_found <EOL> def test_ssh_key_validation ( ) : <EOL> client = _min_client ( "<STR_LIT>" ) <EOL> mapper = FileActionMapper ( client ) <EOL> exception_found = False <EOL> try : <EOL> mapper . action ( '<STR_LIT>' , '<STR_LIT:input>' ) <EOL> except Exception as e : <EOL> exception_found = True <EOL> assert "<STR_LIT>" in str ( e ) <EOL> assert exception_found <EOL> def test_ssh_key_defaults ( ) : <EOL> client = _client ( "<STR_LIT>" ) <EOL> mapper = FileActionMapper ( client ) <EOL> action = mapper . action ( '<STR_LIT>' , '<STR_LIT:input>' ) <EOL> action . to_dict ( ) <EOL> def _min_client ( default_action ) : <EOL> """<STR_LIT>""" <EOL> mock_client = Bunch ( <EOL> default_file_action = default_action , <EOL> action_config_path = None , <EOL> files_endpoint = None , <EOL> ssh_key = None , <EOL> ) <EOL> return mock_client <EOL> def _client ( default_action ) : <EOL> mock_client = Bunch ( <EOL> default_file_action = default_action , <EOL> action_config_path = None , <EOL> files_endpoint = "<STR_LIT>" , <EOL> ssh_key = "<STR_LIT>" , <EOL> ) <EOL> return mock_client </s>
