Skip to content

Added extract all parameter to test_plan_client method #515

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def get_test_suite_by_id(self, project, plan_id, suite_id, expand=None):
query_parameters=query_parameters)
return self._deserialize('TestSuite', response)

def get_test_suites_for_plan(self, project, plan_id, expand=None, continuation_token=None, as_tree_view=None):
def get_test_suites_for_plan(self, project, plan_id, expand=None, continuation_token=None, as_tree_view=None, extract_all=False):
"""GetTestSuitesForPlan.
Get test suites for plan.
:param str project: Project ID or project name
Expand All @@ -361,6 +361,9 @@ def get_test_suites_for_plan(self, project, plan_id, expand=None, continuation_t
version='7.0',
route_values=route_values,
query_parameters=query_parameters)
if extract_all and 'x-ms-continuationtoken' in response.headers:
continuation_token = response.headers['x-ms-continuationtoken']
return self._deserialize('[TestPlan]', self._unwrap_collection(response)) + self.get_test_plans(project, plan_id, expand=expand, continuation_token=continuation_token, as_tree_view=as_tree_view, extract_all=True)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The response is being deserialized using self._deserialize('[TestPlan]', ...). I believe this should be self._deserialize('[TestSuite]', ...) to match the method's return type and the API response structure.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also the recursive call is made to self.get_test_plans(...). I believe it should be calling self.get_test_suites_for_plan(...) to fetch the next page of test suites. If i am correct (which i might not be) then due to calling the wrong method (get_test_plans), the arguments are mismatched. plan_id is passed where owner is expected.

return self._deserialize('[TestSuite]', self._unwrap_collection(response))

def update_test_suite(self, test_suite_update_params, project, plan_id, suite_id):
Expand Down