Skip to content
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

Review: CSClient.get doc inconsistent with behavior #47

Open
ftsfranklin opened this issue May 5, 2021 · 0 comments
Open

Review: CSClient.get doc inconsistent with behavior #47

ftsfranklin opened this issue May 5, 2021 · 0 comments

Comments

@ftsfranklin
Copy link

The docstring says it returns the {success, data} dict.

Returns:
A dictionary containing the response (i.e. {"success": True, "data:": {}}

However, the code unwraps the dict and only returns the data value.

return self._dispatch(cmd).get('data')
return json.loads(response.text).get('data')

Other potential improvements:

  • Check success.
  • Use response.json() instead of json.loads(response.text).
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

No branches or pull requests

1 participant