def __init__(self, cluster: Cluster, model_version_id: int, servable_name: str, status: ServableStatus, status_message: Optional[str], deployment_configuration_name: Optional[str], metadata: Optional[dict] = None) -> 'Servable': self.model_version_id = model_version_id self.name = servable_name self.meta = metadata or {} self.cluster = cluster self.status = status self.status_message = status_message self.deployment_configuration_name = deployment_configuration_name self.model_version = ModelVersion.find_by_id(cluster, self.model_version_id)
def test_modelversion_find_by_id(cluster: Cluster, model_version_builder: ModelVersionBuilder): mv: ModelVersion = model_version_builder.build(cluster) mv_found: ModelVersion = ModelVersion.find_by_id(cluster, mv.id) assert mv.id == mv_found.id