예제 #1
0
def test_arideda_empty_df():
    """
    Test if error occurs when repsonse type is not categorical or continuous
    """
    with pytest.raises(AssertionError):
        aa.arid_eda(
            data.iris(),
            "species",
            "ORDINAL",
            ["sepalLength", "sepalWidth"])
예제 #2
0
def test_response_type_incorrect():
    """
    Test if an error occurs when wrong response type is given
    """
    with pytest.raises(AssertionError):
        aa.arid_eda(
            data.iris(),
            "petalLength",
            "categorical",
            ["sepalLength", "sepalWidth"]
        )
예제 #3
0
def test_arideda_numfeature():
    """
    Ensure data frame is appropriate size according to features
    """
    features = ["sepalLength", "sepalWidth"]
    out, _ = aa.arid_eda(data.iris(), "species", "categorical", features)
    assert out.shape == (8, len(features))
예제 #4
0
def test_arideda_features():
    """
    Test calling with valid features list
    """
    out, _ = aa.arid_eda(
        data.iris(), "species", "categorical", ["sepalLength", "sepalWidth"]
    )
    assert isinstance(out, pd.core.frame.DataFrame)
예제 #5
0
def test_arideda_return():
    """
    Test return data type
    """
    _, out = aa.arid_eda(
        data.iris(), "species", "categorical", ["sepalLength", "sepalWidth"]
    )
    assert isinstance(out, alt.HConcatChart)
예제 #6
0
def test_arideda_returns_tuple():
    """
    Check that function returns two items
    """
    assert (
        len(
            aa.arid_eda(
                data.iris(),
                "species",
                "categorical",
                ["sepalLength", "sepalWidth"]
            )
        )
        == 2
    )