|
|
@@ -56,22 +56,11 @@ def test_post_octiva():
|
|
|
data = base64.b64encode(buffer).decode()
|
|
|
image_artefact = Artefact("inline", data, "", "base64")
|
|
|
algo_artefact = Artefact("inline", f"print('hello')", "", "text/plain")
|
|
|
-
|
|
|
mock_input = {
|
|
|
"ctrl": "cin",
|
|
|
"input": {
|
|
|
- "image": {
|
|
|
- "type": image_artefact.type,
|
|
|
- "content": image_artefact.content,
|
|
|
- "name": image_artefact.name,
|
|
|
- "encoding": image_artefact.encoding,
|
|
|
- },
|
|
|
- "algorithm": {
|
|
|
- "type": algo_artefact.type,
|
|
|
- "content": algo_artefact.content,
|
|
|
- "name": algo_artefact.name,
|
|
|
- "encoding": algo_artefact.encoding,
|
|
|
- },
|
|
|
+ "image": image_artefact.as_dict(),
|
|
|
+ "algorithm": algo_artefact.as_dict(),
|
|
|
}
|
|
|
}
|
|
|
response = client.post("/octiva/", json=mock_input)
|
|
|
@@ -86,17 +75,7 @@ def test_post_octiva():
|
|
|
assert response.json() == {
|
|
|
"ctrl": "ok",
|
|
|
"output": {
|
|
|
- "image": {
|
|
|
- "type": annotated_image_artefact.type,
|
|
|
- "content": annotated_image_artefact.content,
|
|
|
- "name": annotated_image_artefact.name,
|
|
|
- "encoding": annotated_image_artefact.encoding
|
|
|
- },
|
|
|
- "data": {
|
|
|
- "type": data_artefact.type,
|
|
|
- "content": data_artefact.content,
|
|
|
- "name": data_artefact.name,
|
|
|
- "encoding": data_artefact.encoding
|
|
|
- },
|
|
|
+ "image": annotated_image_artefact.as_dict(),
|
|
|
+ "data": data_artefact.as_dict(),
|
|
|
}
|
|
|
}
|