Skip to content

Commit

Permalink
Follow pep8 (mostly)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Spelchak committed Feb 7, 2018
1 parent 385de92 commit 76b771d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
11 changes: 5 additions & 6 deletions lib/galaxy/jobs/dynamic_tool_destination.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def __validate_destination(cls, valid_rule, return_bool, rule, tool, counter):
if priority not in priority_list:
error = "Invalid priority '"
error += str(priority) + "' for rule "
error += str(counter) + " in '" + str(tool) +"'."
error += str(counter) + " in '" + str(tool) + "'."
if not return_bool:
error += " Ignoring..."
if verbose:
Expand Down Expand Up @@ -691,7 +691,7 @@ def parse_yaml(path="/config/tool_destinations.yml", job_conf_path="/config/job_

global destination_list
destination_list = get_destination_list_from_job_config(job_config_location=job_conf_path)

# Import file from path
try:
if test:
Expand Down Expand Up @@ -1461,7 +1461,7 @@ def map_tool_to_destination(

if destination == "fail":
if fail_message:
raise JobMappingException(fail_message) ###: Should an exception occur when there are no default destinations?
raise JobMappingException(fail_message) ### Should an exception occur when there are no default destinations?
else:
raise JobMappingException(matched_rule["fail_message"])

Expand Down Expand Up @@ -1497,9 +1497,9 @@ def get_destination_list_from_job_config(job_config_location='/config/job_conf.x

if job_config_location == "/config/job_conf.xml":
config_location = os.path.join(
os.path.dirname(os.path.realpath(__file__)), '../../..')
os.path.dirname(os.path.realpath(__file__)), '../../..')
job_config_location = config_location + job_config_location

job_conf = ET.parse(job_config_location)

for destination in job_conf.getroot().iter("destination"):
Expand Down Expand Up @@ -1556,7 +1556,6 @@ def get_destination_list_from_job_config(job_config_location='/config/job_conf.x
elif args.check_config:
valid_config = parse_yaml(path=args.check_config, job_conf_path="/config/job_conf.xml", return_bool=True)


elif args.job_config:
valid_config = parse_yaml(path="/config/tool_destinations.yml", job_conf_path=args.job_config, return_bool=True)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def test_arguments_no_err_msg(self, l):
l.check(
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),
('galaxy.jobs.dynamic_tool_destination', 'DEBUG',
"Missing a fail_message for rule 1 in 'spades'. Adding generic fail_message."),
"Missing a fail_message for rule 1 in 'spades'. Adding generic fail_message."),
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')
)

Expand All @@ -437,7 +437,7 @@ def test_arguments_no_args(self, l):
l.check(
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),
('galaxy.jobs.dynamic_tool_destination', 'DEBUG',
"No arguments found for rule 1 in 'spades' despite being of type arguments. Ignoring rule."),
"No arguments found for rule 1 in 'spades' despite being of type arguments. Ignoring rule."),
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')
)

Expand Down Expand Up @@ -666,7 +666,7 @@ def test_rule_destination_not_in_job_conf(self, l):
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Destination for 'blegh', rule 1: 'fake_destination' does not exist in job configuration. Ignoring..."),
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')
)

@log_capture()
def test_tool_default_destination_not_in_job_conf(self, l):
dt.parse_yaml(path=yt.ivYMLTest151, job_conf_path=job_conf_path, test=True)
Expand All @@ -675,7 +675,7 @@ def test_tool_default_destination_not_in_job_conf(self, l):
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination for 'blah': 'not_true_destination' does not appear in the job configuration."),
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')
)

@log_capture()
def test_default_destination_not_in_job_conf(self, l):
dt.parse_yaml(path=yt.ivYMLTest152, job_conf_path=job_conf_path, test=True)
Expand All @@ -693,7 +693,7 @@ def test_rule_destination_without_priority_not_in_job_conf(self, l):
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Destination for 'blegh', rule 1: 'fake_destination' does not exist in job configuration. Ignoring..."),
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')
)

@log_capture()
def test_tool_default_destination_without_priority_not_in_job_conf(self, l):
dt.parse_yaml(path=yt.ivYMLTest154, job_conf_path=job_conf_path, test=True)
Expand All @@ -702,7 +702,7 @@ def test_tool_default_destination_without_priority_not_in_job_conf(self, l):
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination for 'blah': 'not_true_destination' does not appear in the job configuration."),
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')
)

@log_capture()
def test_default_destination_without_priority_not_in_job_conf(self, l):
dt.parse_yaml(path=yt.ivYMLTest155, job_conf_path=job_conf_path, test=True)
Expand Down

0 comments on commit 76b771d

Please sign in to comment.