"""
Package-level API checks: the public surface is importable and internally consistent.
"""

import pytest
import plotting_utils as plu


def test_version():
    assert isinstance(plu.__version__, str)
    assert plu.__version__.count(".") >= 1


def test_all_names_are_exported():
    """Every name in __all__ must actually resolve on the package."""
    missing = [name for name in plu.__all__ if not hasattr(plu, name)]
    assert not missing, f"__all__ lists names that do not exist: {missing}"


@pytest.mark.parametrize("name", [
    "set_rcParams", "create_palette", "ten_godisnot", "darjeeling", "fantastic_fox",
    "add_cbar", "format_ax", "add_legend", "add_wilcox",
    "scatter", "dist", "counts_plot", "bar", "box", "strip", "violin",
    "bb_plot", "plot_heatmap", "stem_plot", "rank_plot", "dotplot", "volcano",
    "order_from_index", "Timer", "run_command", "make_folder", "update_params",
    "save_best_pdf_quality",
])
def test_public_name_available(name):
    """Guards against regressions like a dropped comma silently hiding a name."""
    assert hasattr(plu, name)
    assert name in plu.__all__
