Skip to content
Snippets Groups Projects
Commit 6abf3688 authored by John Chilton's avatar John Chilton
Browse files

One more action mapper test for scp stuff.

parent ca040eba
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ from pulsar.client.action_mapper import (
def test_endpoint_validation():
client = _client("remote_transfer")
client = _min_client("remote_transfer")
mapper = FileActionMapper(client)
exception_found = False
try:
......@@ -17,21 +17,40 @@ def test_endpoint_validation():
def test_ssh_key_validation():
client = _client("remote_rsync_transfer")
client = _min_client("remote_rsync_transfer")
mapper = FileActionMapper(client)
exception_found = False
try:
action = mapper.action('/opt/galaxy/tools/filters/catWrapper.py', 'input')
mapper.action('/opt/galaxy/tools/filters/catWrapper.py', 'input')
except Exception as e:
exception_found = True
assert "ssh_key" in e.message
assert exception_found
def _client(default_action):
def test_ssh_key_defaults():
client = _client("remote_rsync_transfer")
mapper = FileActionMapper(client)
action = mapper.action('/opt/galaxy/tools/filters/catWrapper.py', 'input')
action.to_dict()
def _min_client(default_action):
"""Minimal client, missing properties for certain actions."""
mock_client = Bunch(
default_file_action=default_action,
action_config_path=None,
files_endpoint=None,
ssh_key=None,
)
return mock_client
def _client(default_action):
mock_client = Bunch(
default_file_action=default_action,
action_config_path=None,
files_endpoint="http://localhost",
ssh_key="12345",
)
return mock_client
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment