import pandas as pd

from proxai_ms.training import train_binary_classifier


def test_train_binary_classifier(tmp_path):
    csv_path = tmp_path / "tiny.csv"

    df = pd.DataFrame(
        {
            "label": [0, 1, 0],
            "cast_0": [1.0, 2.0, 3.0],
            "cast_1": [0.5, 0.1, 0.0],
        }
    )
    df.to_csv(csv_path, index=False)

    result = train_binary_classifier(csv_path)
    assert result["rows"] == 3