Closed roaasallam closed 4 months ago
If I understand the question correctly, I think this should work if you make your function return a dictionary with the file
key like
def read_from_file(filename):
return {
"file": ...
}
And use it in the test like
files:
file: "tests/acceptance/testdata/auto-written-file-upload.csv"
data:
$ext:
function: testing_utils:read_from_file
kwargs:
filename: auto-written-file-upload.csv
Basically you can't have a $ext
function anywhere except the top level of a 'data' json' etc. block
I have an endpoint which accepts multipart form data,
I have wrote python function to write random content in a csv file,
Is there a way to pass this file in the request data using the python function that returns the file?
thanks,
`
`