-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from cat-bro/helpers-for-tool-version-comparison
Add helpers for tool version comparison
- Loading branch information
Showing
4 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -226,3 +226,42 @@ def create_job(app, mock_user, mock_tool): | |
with self.assertRaises(JobNotReadyException): | ||
tpv_config = os.path.join(os.path.dirname(__file__), 'fixtures/mapping-rule-tool-limits.yml') | ||
self._map_to_destination(tool_total_limit_3, user_roosta, datasets, tpv_config_files=[tpv_config], app=app) | ||
|
||
def test_tool_version_comparison_helpers(self): | ||
tpv_config = os.path.join(os.path.dirname(__file__), 'fixtures/mapping-rule-tool-limits.yml') | ||
user = mock_galaxy.User('ford', '[email protected]') | ||
datasets = [mock_galaxy.DatasetAssociation("test", mock_galaxy.Dataset("test.txt", file_size=1*1024**3))] | ||
|
||
def mock_trinity_with_version(version): | ||
return mock_galaxy.Tool( | ||
id=f'toolshed.g2.bx.psu.edu/repos/iuc/trinity/trinity/{version}', | ||
version=version | ||
) | ||
|
||
env_keys = [ # env keys that may be added by cooked trinity rules | ||
'version_gte_2.15.1+galaxy0', | ||
'version_gt_2.15.1+galaxy0', | ||
'version_lt_2.10.1+galaxy7', | ||
'version_lte_2.10.1+galaxy7', | ||
] | ||
# trinity version 3.15.1+galaxy0 | ||
tool = mock_trinity_with_version('3.15.1+galaxy0') | ||
destination = self._map_to_destination(tool, user, datasets, tpv_config_files=[tpv_config]) | ||
self.assertCountEqual( | ||
[e.get('name') for e in destination.env if e.get('name') in env_keys], | ||
['version_gte_2.15.1+galaxy0', 'version_gt_2.15.1+galaxy0'], | ||
) | ||
# trinity version 2.15.1+galaxy0 | ||
tool = mock_trinity_with_version('2.15.1+galaxy0') | ||
destination = self._map_to_destination(tool, user, datasets, tpv_config_files=[tpv_config]) | ||
self.assertCountEqual( | ||
[e.get('name') for e in destination.env if e.get('name') in env_keys], | ||
['version_gte_2.15.1+galaxy0'], | ||
) | ||
# trinity version 2.10.1+galaxy6 | ||
tool = mock_trinity_with_version('2.10.1+galaxy6') | ||
destination = self._map_to_destination(tool, user, datasets, tpv_config_files=[tpv_config]) | ||
self.assertCountEqual( | ||
[e.get('name') for e in destination.env if e.get('name') in env_keys], | ||
['version_lt_2.10.1+galaxy7', 'version_lte_2.10.1+galaxy7'], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters