from pyucc.utils.csv_exporter import export_rows_to_csv


def test_export_rows_to_csv(tmp_path):
    p = tmp_path / "out.csv"
    headers = ["name", "value"]
    rows = [["a", "1"], ["b", "2"]]
    written = export_rows_to_csv(p, headers, rows)
    assert written == 2
    text = p.read_text(encoding='utf-8').splitlines()
    assert text[0].strip() == "name,value"
    assert len(text) == 3
