send json instead of data

This commit is contained in:
Matthias Bisping 2022-04-28 18:05:07 +02:00
parent 0d503d1c1d
commit f47d458217
2 changed files with 2 additions and 3 deletions

View File

@ -10,7 +10,6 @@ from test.utils.server import bytes_to_string, string_to_bytes
def pack(data: bytes, metadata: dict):
package = {"data": bytes_to_string(data), "metadata": metadata}
package = json.dumps(package).encode()
return package
@ -29,7 +28,7 @@ def make_processor(operation, buffer_size=3):
current_buffer_size = len(buffer)
return (final or buffer_full(current_buffer_size)) * current_buffer_size
get_data_from_request = compose(string_to_bytes, itemgetter("data"), json.loads, lambda p: p.data.decode())
get_data_from_request = compose(string_to_bytes, itemgetter("data"), lambda p: p.json)
operation = compose(bytes_to_string, operation)

View File

@ -44,7 +44,7 @@ def parallel_map(f1, f2):
def post_partial(url, input_data: Iterable[bytes], metadata):
def send(method, data):
return method(url, data=data)
return method(url, json=data)
def dispatch_method(input_data):
def is_last_item():