Skip to content

Conversation

@sti0
Copy link
Contributor

@sti0 sti0 commented Dec 27, 2020

This forces the mockup encoding to utf-8. Rest client expects a utf-8 encoding:

response.encoding = "utf-8"

Prior Python 3.9: without encoding files are read with system default codepage, e.g. windows = cp1252.

E.g. Python 3.8

encoding is the name of the encoding used to decode or encode the file. This should only be used in text mode. The default encoding is platform dependent (whatever locale.getpreferredencoding() returns), but any text encoding supported by Python can be used. See the codecs module for the list of supported encodings.

Additionaly the exec global "null": None is added, because BB cloud api may return the value null instead of None.

@sti0 sti0 changed the title [Bitbucket Cloud] Test-Mockup encoding [Bitbucket Cloud] Test-Mockup encoding / exec global Dec 27, 2020
@Spacetown
Copy link
Contributor

For which response is the "null" needed?

@sti0
Copy link
Contributor Author

sti0 commented Dec 27, 2020

I simply dumped the json from the pull request response for unit tests and some attributes are null.
At the docs they can be null:
image

@Spacetown
Copy link
Contributor

Ok, in my previous dumps there wasn't a null.

Copy link
Contributor

@Spacetown Spacetown left a comment

Choose a reason for hiding this comment

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

LGFM

@gonchik gonchik merged commit b4ad06a into atlassian-api:master Dec 29, 2020
@gonchik
Copy link
Member

gonchik commented Dec 29, 2020

Thank you!

@sti0 sti0 deleted the bugfix/mockup-encoding branch December 29, 2020 16:02
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