-
Notifications
You must be signed in to change notification settings - Fork 10
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 #150 from seermedical/fix-labelgroups2
Fix get_paginated_response when `iteration_path` returns empty on first iteration
- Loading branch information
Showing
5 changed files
with
108 additions
and
8 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
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
""" | ||
Data for mocking intermediate function calls, as well as expected return values | ||
when testing the following functions: | ||
- client.get_label_groups_for_studies() | ||
- client.get_label_groups_for_studies_dataframe() | ||
For condition in which the studies do not contain any label groups. | ||
""" | ||
import io | ||
import pandas as pd | ||
|
||
# Individual responses it gets from calling client.get_label_groups_for_study() | ||
individual_study_responses = [ | ||
{ | ||
"id": "study1_id", | ||
"name": "study1_name", | ||
"labelGroups": [] | ||
}, | ||
{ | ||
"id": "study2_id", | ||
"name": "study2_name", | ||
"labelGroups": [] | ||
} | ||
] | ||
|
||
# The expected result from client.get_label_groups_for_studies() | ||
expected_seerpy_response = [ | ||
{ | ||
"id": "study1_id", | ||
"name": "study1_name", | ||
"labelGroups": [] | ||
}, | ||
{ | ||
"id": "study2_id", | ||
"name": "study2_name", | ||
"labelGroups": [] | ||
}, | ||
] | ||
|
||
# The expected result from client.get_label_groups_for_studies_dataframe() | ||
expected_seerpy_df = pd.DataFrame([]) |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
""" | ||
Data for mocking intermediate function calls, as well as expected return values | ||
when testing the following function: | ||
- client.get_label_groups_for_study() | ||
For condition in which the study does not contain any label groups. | ||
""" | ||
|
||
# Mocked paginated responses on each subsequent call of client.execute_query() | ||
# within the client.get_paginated_response() function that gets called by | ||
# client.get_label_groups_for_study() | ||
raw_paginated_responses = [ | ||
{ | ||
"study": { | ||
"id": "study1_id", | ||
"name": "study1_name", | ||
"labelGroups": [] | ||
} | ||
}, | ||
] | ||
|
||
# Expected return value when calling client.get_label_groups_for_study() | ||
expected_seerpy_response = { | ||
"id": "study1_id", | ||
"name": "study1_name", | ||
"labelGroups": [] | ||
} |
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