# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
# Issues & docs: https://github.com/kreuzberg-dev/alef
# E2e tests for category: plugin_api

test_that("register_document_extractor_trait_bridge: register_document_extractor: trait bridge", {
    r_backend_register_document_extractor_trait_bridge <- list(
    name = "test-extractor",
    initialize = function() invisible(NULL),
    shutdown = function() invisible(NULL),
    extract_bytes = function(content, mime_type, config) InternalDocument(),
    supported_mime_types = function() c()
  )
  invisible(register_document_extractor(r_backend = r_backend_register_document_extractor_trait_bridge))
  expect_true(TRUE)
  unregister_document_extractor("test-extractor")
})

test_that("register_embedding_backend_trait_bridge: register_embedding_backend: trait bridge", {
    r_backend_register_embedding_backend_trait_bridge <- list(
    name = "test-embedding-backend",
    initialize = function() invisible(NULL),
    shutdown = function() invisible(NULL),
    dimensions = function() 768,
    embed = function(texts) c()
  )
  invisible(register_embedding_backend(r_backend = r_backend_register_embedding_backend_trait_bridge))
  expect_true(TRUE)
  unregister_embedding_backend("test-embedding-backend")
})

test_that("register_ocr_backend_trait_bridge: register_ocr_backend: trait bridge", {
    r_backend_register_ocr_backend_trait_bridge <- list(
    name = "test-backend",
    initialize = function() invisible(NULL),
    shutdown = function() invisible(NULL),
    process_image = function(image_bytes, config) ExtractionResult(),
    supports_language = function(lang) FALSE,
    backend_type = function() OcrBackendType()
  )
  invisible(register_ocr_backend(r_backend = r_backend_register_ocr_backend_trait_bridge))
  expect_true(TRUE)
  unregister_ocr_backend("test-backend")
})

test_that("register_post_processor_trait_bridge: register_post_processor: trait bridge", {
    r_backend_register_post_processor_trait_bridge <- list(
    name = "test-processor",
    initialize = function() invisible(NULL),
    shutdown = function() invisible(NULL),
    process = function(result, config) NULL,
    processing_stage = function() ProcessingStage()
  )
  invisible(register_post_processor(r_backend = r_backend_register_post_processor_trait_bridge))
  expect_true(TRUE)
  unregister_post_processor("test-processor")
})

test_that("register_renderer_trait_bridge: register_renderer: trait bridge", {
    r_backend_register_renderer_trait_bridge <- list(
    name = "test-renderer",
    initialize = function() invisible(NULL),
    shutdown = function() invisible(NULL),
    render = function(doc) ""
  )
  invisible(register_renderer(r_backend = r_backend_register_renderer_trait_bridge))
  expect_true(TRUE)
  unregister_renderer("test-renderer")
})

test_that("register_validator_trait_bridge: register_validator: trait bridge", {
    r_backend_register_validator_trait_bridge <- list(
    name = "test-validator",
    initialize = function() invisible(NULL),
    shutdown = function() invisible(NULL),
    validate = function(result, config) NULL
  )
  invisible(register_validator(r_backend = r_backend_register_validator_trait_bridge))
  expect_true(TRUE)
  unregister_validator("test-validator")
})

test_that("unregister_document_extractor_after_register: unregister_document_extractor", {
  invisible(unregister_document_extractor(name = "test-extractor"))
  expect_true(TRUE)
})

test_that("unregister_embedding_backend_after_register: unregister_embedding_backend", {
  invisible(unregister_embedding_backend(name = "test-embedding-backend"))
  expect_true(TRUE)
})

test_that("unregister_post_processor_after_register: unregister_post_processor", {
  invisible(unregister_post_processor(name = "test-processor"))
  expect_true(TRUE)
})

test_that("unregister_renderer_after_register: unregister_renderer", {
  invisible(unregister_renderer(name = "test-renderer"))
  expect_true(TRUE)
})

test_that("unregister_validator_after_register: unregister_validator", {
  invisible(unregister_validator(name = "test-validator"))
  expect_true(TRUE)
})
