Skip to content

Commit

Permalink
Start adding tests
Browse files Browse the repository at this point in the history
Added two tests to check if correct destinations were recommended
when 'waffles_low' was mispelled in default destinations sections.
  • Loading branch information
Matthew Spelchak committed Feb 15, 2018
1 parent a2bf469 commit cc8a905
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,24 @@ def test_default_dest_is_string_but_priorities_used_in_tool_default_dest(self, l
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')
)

@log_capture()
def test_typo_in_str_default_dest(self, l):
dt.parse_yaml(path=yt.ivYMLTest164, job_conf_path=job_conf_path, test=True)
l.check(
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination 'waffles-Low' does not appear in the job configuration. Did you mean 'waffles_low'?"),
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')
)

@log_capture()
def test_typo_in_dict_default_dest(self, l):
dt.parse_yaml(path=yt.ivYMLTest165, job_conf_path=job_conf_path, test=True)
l.check(
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Running config validation...'),
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', "Default destination 'waffles_kow' does not appear in the job configuration. Did you mean 'waffles_low'?"),
('galaxy.jobs.dynamic_tool_destination', 'DEBUG', 'Finished config validation.')
)

# ================================Valid yaml files==============================
@log_capture()
def test_parse_valid_yml(self, l):
Expand Down
15 changes: 15 additions & 0 deletions test/unit/jobs/dynamic_tool_destination/ymltests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1238,3 +1238,18 @@
priority:
verbose: True
'''

# Typo in str default destination
ivYMLTest164 = '''
default_destination: waffles-kow
verbose: True
'''

# Typo in dict default destination
ivYMLTest165 = '''
default_destination:
priority:
pr: waffles_kow
default_priority: pr
verbose: True
'''

0 comments on commit cc8a905

Please sign in to comment.