-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[VIRTS-2798] Operation Link Results Endpoint #2239
[VIRTS-2798] Operation Link Results Endpoint #2239
Conversation
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.
Let's add a pytest unit test as well to make sure the behavior works as expected - you can try mocking the read_result_file
method for the file service to avoid having to read/write files on disk
Codecov Report
@@ Coverage Diff @@
## master #2239 +/- ##
==========================================
- Coverage 67.74% 67.04% -0.70%
==========================================
Files 90 92 +2
Lines 6963 7286 +323
==========================================
+ Hits 4717 4885 +168
- Misses 2246 2401 +155
Continue to review full report at Codecov.
|
Added fixtures from operations api pytests, along with tests for the new endpoint |
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.
Looks good!
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.
Tested with UI--the endpoint is only called when link output is "True" and the returned result is decoded and displayed to the user. LGTM!
Description
Created new endpoint
GET /operations/{id}/links/{link_id}/result
.In the v1 api, there was an endpoint for fetching encoded link results (
rest_svc.display_result()
). We didn't have this in the api v2 design, but it's necessary as some abilities don't have parsers, preventing some results from being added to link objects as facts.Type of change
How Has This Been Tested?
Tested using Postman, comparing output to v1 API. Also included Pytest unit tests for this endpoint; the rest of the operation pytests will be merged in a separate PR.
Checklist: