Skip to content

Conversation

@ehanson8
Copy link
Contributor

@ehanson8 ehanson8 commented Dec 5, 2019

What does this PR do?

Adding tests for class methods and a endpoint correction

Includes new or updated dependencies?

NO

selected_collections = ''
url = f'/rest/filtered-items?query_field[]={key}&query_op[]='
url += f'{query_type}&query_val[]={string}&collSel[]='
url += f'{selected_collections}&limit=200&offset='
Copy link

Choose a reason for hiding this comment

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

Here again I would start with the query string as a dictionary. Since you aren't passing to requests in this case, you can use https://docs.python.org/3/library/urllib.parse.html#urllib.parse.urlencode to create the query string. Long formatting strings with lots of variables should generally be avoided if possible. They are too prone to typos and difficult to debug.

@ehanson8 ehanson8 merged commit 45b0f26 into refactor Dec 16, 2019
@ehanson8 ehanson8 deleted the add-tests branch December 16, 2019 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants