def test_external_model_parse(): import json json_str = """ { "id": 138, "created": "2021-09-24T11:29:09.624Z", "finished": "2021-09-24T11:29:09.624Z", "modelVersion": 1, "modelSignature": { "signatureName": "predict", "inputs": [{ "name": "in", "dtype": "DT_DOUBLE", "shape": { "dims": [] }, "profile": "NONE" }], "outputs": [{ "name": "out", "dtype": "DT_DOUBLE", "shape": { "dims": [] }, "profile": "NONE" }] }, "model": { "id": 18, "name": "external-model" }, "status": "Released", "metadata": {}, "applications": [], "image": null, "runtime": null, "monitoringConfiguration": { "batchSize": 100 }, "isExternal": true }""" json_dict = json.loads(json_str) cl = Cluster("asdasd:9091", "asdasd:9090", check_connection=False) mv = ModelVersion._from_json(cl, json_dict) print(mv) assert False
def test_model_json_parser_for_external_models( cluster: Cluster, external_modelversion_json: dict): external_modelversion_json["id"] = 420 mv: ModelVersion = ModelVersion._from_json(cluster, external_modelversion_json) assert mv.id == 420