26 lines
589 B
Python
26 lines
589 B
Python
import json
|
|
from operator import itemgetter, methodcaller
|
|
|
|
import pytest
|
|
import requests
|
|
from funcy import compose, rpartial
|
|
|
|
from pyinfra.rest import pack
|
|
|
|
|
|
@pytest.mark.parametrize("item_type", ["pdf"])
|
|
def test_sending_partial_request(url, server_process, pdf, metadata, operation):
|
|
|
|
def post(data):
|
|
return requests.post(f"{url}/submit", data=data)
|
|
|
|
pickup = compose(itemgetter("pickup_endpoint"), methodcaller("json"), post, rpartial(pack, metadata))(pdf)
|
|
print(pickup)
|
|
|
|
while True:
|
|
response = requests.get(f"{url}/{pickup}")
|
|
print(response)
|
|
|
|
|
|
|