biocore / microsetta-private-api

A private microservice to support The Microsetta Initiative
BSD 3-Clause "New" or "Revised" License
6 stars 19 forks source link

Fixes error in microsetta-interface integration test #500

Closed charles-cowart closed 1 year ago

charles-cowart commented 1 year ago

Fixes an error found when running microsetta-interface integration tests. https://github.com/biocore/microsetta-interface/pull/267

charles-cowart commented 1 year ago

@cassidysymons This small fix is needed to support the microsetta-interface integration test fix. This will resolve most of the errors and partially resolve the last remaining error.

cassidysymons commented 1 year ago

Is this a functional change just to resolve issues with tests? If so, that seems like an issue with the tests, rather than the code itself. Can you explain why this change is necessary?

charles-cowart commented 1 year ago

This isn't a functional change. We added percentage_completed to the SurveyTemplateLinkInfo model class not long ago, per @wasade's suggestion to add it to the model. It's to_api() previously only required survey_answers_id and survey_status, but we added percentage_completed as an additional parameter to add and initialize that key. Depending on when the SurveyTemplateLinkInfo object is created, percentage_completed is set to None for a new object or set to a proper value in read_survey_template().

The additional parameter is needed or else the REST API call pointing to this method will fail.

cassidysymons commented 1 year ago

Gotcha, re-read the code and it makes sense now. Thanks.