def test_check_nulls_bad_ser():
    # verifies that the null check finds rows with nulls
    fail = pd.DataFrame.from_dict({
        'nulls_present': (True, ),
        'null_count': (1, ),
        'prop_null': (0.25, ),
    })
    assert fail.equals(gf.check_nulls(bad_nulls1['b1']))
def test_check_nulls_bad_df():
    # verifies that the null check finds rows with nulls
    fail = pd.DataFrame.from_dict({
        'column': ('b1', 'b2'),
        'nulls_present': (True, False),
        'null_count': (1, 0),
        'prop_null': (0.25, 0.0)
    })
    assert fail.equals(gf.check_nulls(bad_nulls1))
def test_fuzzy_nulls_bad1_df():
    # verifies that the fuzzy null check finds rows with fuzzy nulls
    assert fail_fuzzy_df.equals(gf.check_fuzzy_nulls(bad_fuzzy1))
def test_fuzzy_nulls_good_ser():
    # verifies good data passes the null check
    cols = ['fuzzy_nulls_present', 'fuzzy_null_count', 'prop_fuzzy_null']
    assert not gf.check_fuzzy_nulls(good['g1']).loc[:, cols].any(axis=None)
def test_check_nulls_good_df():
    # verifies good data passes the null check
    cols = ['nulls_present', 'null_count', 'prop_null']
    assert not gf.check_nulls(good).loc[:, cols].any(axis=None)
def test_fuzzy_nulls_bad3_ser():
    # verifies that the fuzzy null check finds rows with added fuzzy nulls
    assert fail_fuzzy_ser.equals(
        gf.check_fuzzy_nulls(bad_fuzzy3['b1'], add_fuzzy_nulls=['foo']))
def test_fuzzy_nulls_bad2_ser():
    # verifies that the fuzzy null check finds rows with fuzzy nulls
    assert fail_fuzzy_ser.equals(gf.check_fuzzy_nulls(bad_fuzzy2['b1']))