code: def test_create_fastapi(tmp_path):
      wrapper = DummyWrapper("dummy", {}, tmp_path)
      app = wrapper._create_fastapi()
      client = TestClient(app)
  
      # index endpoint
      response = client.get("/")
      assert response.status_code == 200
      assert response.json()["model_name"] == "dummy"
      assert response.json()["config"] == {}
  
      # predict endpoint
      # TODO: Maybe test this for a properly trained model (especially the data
      #   conversion).
      response = client.post(
          "/predict", json={"image": [[[0, 1], [1, 0]]]}
      )
      assert response.status_code == 200
      assert response.json()["predicted_class"] == 0
      assert np.all(
          np.array(response.json()["probabilities"])
          == np.array([0.1, 0.9])
      )
  
file_path: traintool/tests/test_model_wrapper.py
imports: from fastapi.testclient import TestClient
  import numpy
  from traintool.model_wrapper import ModelWrapper
label_desc: Use image node_id 2 for calling a global function with example usage: test_create_fastapi(tmp_path) without return types