kopia lustrzana https://gitlab.com/marnanel/chapeau
mock_remote_object() allows its content to be bytes or string
rodzic
03b9262402
commit
243e1d9ca0
|
@ -86,12 +86,18 @@ def mock_remote_object(
|
|||
'Content-Type': 'application/activity+json',
|
||||
}
|
||||
|
||||
if isinstance(content, bytes):
|
||||
body = content
|
||||
else:
|
||||
body = bytes(content, encoding='UTF-8')
|
||||
|
||||
httpretty.register_uri(
|
||||
httpretty.GET,
|
||||
url,
|
||||
status=status,
|
||||
headers=headers,
|
||||
body=bytes(content, encoding='UTF-8'))
|
||||
body = body,
|
||||
)
|
||||
|
||||
logger.debug('Mocking %s as %d: %s',
|
||||
url,
|
||||
|
|
Ładowanie…
Reference in New Issue