code: def test_override_asset():
      class TestModel(Model):
          def _load(self):
              pass
  
          def _predict(self, item, **kwargs):
              return self.asset_path
  
      class TestDepModel(Model):
          def _predict(self, item, **kwargs):
              return "dep" + self.asset_path
  
      config = {
          "some_asset": ModelConfiguration(
              model_type=TestModel,
              asset="asset/that/does/not/exist",
              model_dependencies={"dep_model"},
          ),
          "dep_model": ModelConfiguration(model_type=TestDepModel),
      }
      # The asset does not exist
      with pytest.raises(AssetDoesNotExistError):
          model_library = ModelLibrary(
              required_models=["some_asset"], configuration=config
          )
  
      # It does when overriden
      model_library = ModelLibrary(
          required_models={"some_asset": {"asset_path": "/the/path"}},
          configuration=config,
      )
      model = model_library.get("some_asset")
      assert "/the/path" == model({})
  
      # Dependent models are loaded properly
      model = model_library.get("dep_model")
      assert "dep" == model({})
  
      # Finally, it is possible to also specify
      # an asset for the dependent model
      config["dep_model"] = ModelConfiguration(
          model_type=TestDepModel, asset="cat/someasset"
      )
      model_library = ModelLibrary(
          required_models={
              "some_asset": {"asset_path": "/the/path"},
              "dep_model": {"asset_path": "/the/dep/path"},
          },
          configuration=config,
      )
      # Dependent models are loaded properly
      model = model_library.get("dep_model")
      assert "dep/the/dep/path" == model({})
  
imports: import asyncio
  import os
  import pytest
  from modelkit.assets.errors import AssetDoesNotExistError, InvalidAssetSpecError
  from modelkit.core import errors
  from modelkit.core.library import ConfigurationNotFoundException, ModelLibrary, download_assets, load_model
  from modelkit.core.model import Asset, AsyncModel, Model
  from modelkit.core.model_configuration import ModelConfiguration, _configurations_from_objects, configure, list_assets
  from modelkit.core.settings import LibrarySettings
  from tests import TEST_DIR, testmodels
  from tests.assets.test_versioning import test_versioning
label_desc: Use image node_id 2 for calling a global function with example usage: test_override_asset() and returns: self, unknown