"""Test that the package can be installed and imported correctly."""


def test_package_import():
    """Test that the veritell_langchain package can be imported."""
    import veritell_langchain

    assert veritell_langchain is not None
    assert hasattr(veritell_langchain, "__version__")


def test_evaluator_import():
    """Test that VeritellEvaluator can be imported from the package."""
    from veritell_langchain import VeritellEvaluator

    assert VeritellEvaluator is not None


def test_result_schema_import():
    """Test that VeritellEvaluationResult can be imported."""
    from veritell_langchain import VeritellEvaluationResult

    assert VeritellEvaluationResult is not None


def test_stream_event_import():
    """Test that VeritellStreamEvent can be imported."""
    from veritell_langchain import VeritellStreamEvent

    assert VeritellStreamEvent is not None


def test_errors_import():
    """Test that error classes can be imported."""
    from veritell_langchain import (
        VeritellAPIError,
        VeritellAuthError,
        VeritellConnectionError,
        VeritellError,
        VeritellValidationError,
    )

    assert VeritellError is not None
    assert VeritellAuthError is not None
    assert VeritellAPIError is not None
    assert VeritellConnectionError is not None
    assert VeritellValidationError is not None


def test_all_exports():
    """Test that __all__ contains expected exports."""
    from veritell_langchain import __all__

    expected_exports = [
        "VeritellEvaluator",
        "VeritellEvaluationResult",
        "VeritellStreamEvent",
        "VeritellError",
        "VeritellAuthError",
        "VeritellAPIError",
        "VeritellConnectionError",
        "VeritellValidationError",
    ]
    for export in expected_exports:
        assert export in __all__, f"{export} not in __all__"


def test_module_structure():
    """Test that the module has the expected structure."""
    import veritell_langchain

    assert hasattr(veritell_langchain, "evaluator")
    assert hasattr(veritell_langchain, "schema")
    assert hasattr(veritell_langchain, "errors")
    assert hasattr(veritell_langchain, "config")
