Skip to content

Commit

Permalink
Clean up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Spelchak committed Feb 7, 2018
1 parent acb0f15 commit 385de92
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
10 changes: 2 additions & 8 deletions lib/galaxy/jobs/dynamic_tool_destination.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,6 @@ def __validate_destination(cls, valid_rule, return_bool, rule, tool, counter):
elif isinstance(rule["destination"], dict):
if ("priority" in rule["destination"] and isinstance(rule["destination"]["priority"], dict)):

#### new code

for priority in rule["destination"]["priority"]:
if priority not in priority_list:
error = "Invalid priority '"
Expand Down Expand Up @@ -452,7 +450,6 @@ def __validate_destination(cls, valid_rule, return_bool, rule, tool, counter):
log.debug(error)
valid_rule = False

#### new code ends here
else:
error = "No destination specified for rule " + str(counter)
error += " in '" + str(tool) + "'."
Expand Down Expand Up @@ -804,8 +801,6 @@ def infinite_defaultdict():
if ('priority' in obj['default_destination'] and
isinstance(obj['default_destination']['priority'], dict)):

#### My new code

for priority in obj['default_destination']['priority']:

if isinstance(obj['default_destination']['priority'][priority],
Expand Down Expand Up @@ -859,7 +854,6 @@ def infinite_defaultdict():

if isinstance(curr, dict):
if 'priority' in curr and isinstance(curr['priority'], str):
#### my new code

if curr['priority'] in priority_list:
new_config['users'][user]['priority'] = curr['priority']
Expand Down Expand Up @@ -915,7 +909,7 @@ def infinite_defaultdict():
elif isinstance(curr['default_destination'], dict):

if ('priority' in curr['default_destination'] and isinstance(curr['default_destination']['priority'], dict)):
#### new code

### May not be necessary check if something has all priorities specified as default
for priority in priority_list:
if priority not in curr['default_destination']['priority']:
Expand Down Expand Up @@ -1467,7 +1461,7 @@ def map_tool_to_destination(

if destination == "fail":
if fail_message:
raise JobMappingException(fail_message) ###TODO: 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
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,6 @@ def test_tool_with_invalid_priority_destination(self, l):
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')
)

#### New Tests

@log_capture()
def test_not_all_priorities_in_tool(self, l):
dt.parse_yaml(path=yt.ivYMLTest149, job_conf_path=job_conf_path, test=True)
Expand All @@ -661,7 +659,7 @@ def test_not_all_priorities_in_tool(self, l):
)

@log_capture()
def test_rule_destination_not_in_job_conf(self, l): ### Also test when desination is just a string, not a priority?
def test_rule_destination_not_in_job_conf(self, l):
dt.parse_yaml(path=yt.ivYMLTest150, job_conf_path=job_conf_path, test=True)
l.check(
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),
Expand Down
2 changes: 0 additions & 2 deletions test/unit/jobs/dynamic_tool_destination/ymltests.py
Original file line number Diff line number Diff line change
Expand Up @@ -946,8 +946,6 @@
verbose: True
'''

#### New Tests

# not all priorities in tool destinations
ivYMLTest149 = '''
default_destination:
Expand Down

0 comments on commit 385de92

Please sign in to comment.