New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scottx611x/td api fixes #1653
Scottx611x/td api fixes #1653
Conversation
…the tool's output file(s)
Codecov Report
@@ Coverage Diff @@
## develop #1653 +/- ##
===========================================
- Coverage 37.64% 36.98% -0.66%
===========================================
Files 369 263 -106
Lines 24317 20601 -3716
Branches 1260 1253 -7
===========================================
- Hits 9153 7620 -1533
+ Misses 15164 12980 -2184
- Partials 0 1 +1
Continue to review full report at Codecov.
|
refinery/tool_manager/utils.py
Outdated
""" | ||
Mock of `get_workflow_list()` | ||
Unserializes galaxy workflow response data that was serialized prior. | ||
:filename: String containing filename of prior serialized Galaxy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function doesn't actually take a file name. I'd either update the docstring or (preferably) refactor the function to accept an actual file name (including the extension).
refinery/tool_manager/utils.py
Outdated
@@ -282,11 +282,13 @@ def get_workflow_list(): | |||
return workflow_list | |||
|
|||
|
|||
def mock_get_workflow_list(): | |||
def mock_get_workflow_list(filename): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function simply reads a JSON file content and loads it into a Python object, so I'd name it accordingly and make it re-useable by allowing to specify any file path.
refinery/tool_manager/tests.py
Outdated
side_effect=mock_get_workflow_list): | ||
with mock.patch( | ||
'tool_manager.utils.get_workflow_list', | ||
side_effect=[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hackdna: I could also just nix the mock_get_workflow_list()
and do the json.loads()
in this side_effect
array here? thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, that's probably even better in this case.
refinery/tool_manager/tests.py
Outdated
with mock.patch('tool_manager.utils.get_workflow_list', | ||
side_effect=mock_get_workflow_list): | ||
invalid_workflows = open( | ||
"tool_manager/test_data/invalid_galaxy_workflows.json" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DRY: tool_manager/test_data/
should be stored in a variable.
Small fixes for ToolDefinition API code brought to light by writing documentation for it.