Skip to content
Snippets Groups Projects
Commit c244b5a2 authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

FIX: type of body for MockupResponse

parent c6aa4f94
No related branches found
No related tags found
1 merge request!55FIX: new systems expect encoded body
Pipeline #21290 failed
...@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ...@@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#75](https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/issues/75), [#103](https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/issues/103) Fixed JSON schema to allow more sections, and correct requirements for * [#75](https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/issues/75), [#103](https://gitlab.indiscale.com/caosdb/src/caosdb-pylib/-/issues/103) Fixed JSON schema to allow more sections, and correct requirements for
password method. password method.
- `read()` of MockupResponse returns now an appropriate type on modern systems
### Security ### ### Security ###
......
...@@ -26,6 +26,7 @@ up a tcp connection.""" ...@@ -26,6 +26,7 @@ up a tcp connection."""
from __future__ import unicode_literals, print_function from __future__ import unicode_literals, print_function
from io import StringIO from io import StringIO
from sys import hexversion
from .connection import CaosDBServerConnection, CaosDBHTTPResponse from .connection import CaosDBServerConnection, CaosDBHTTPResponse
...@@ -56,7 +57,10 @@ class MockUpResponse(CaosDBHTTPResponse): ...@@ -56,7 +57,10 @@ class MockUpResponse(CaosDBHTTPResponse):
def read(self, size=-1): def read(self, size=-1):
"""Return the body of the response.""" """Return the body of the response."""
return self.response.read(size) if hexversion < 0x03000000:
return self.response.read(size)
else:
return self.response.read(size).encode()
def getheader(self, name, default=None): def getheader(self, name, default=None):
"""Get the contents of the header `name`, or `default` if there is no """Get the contents of the header `name`, or `default` if there is no
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment