Пример #1
0
def test_is_categorical():
    """
    Check if the given dataset given a columns
    is categorical or not. 
    
    :raises     AssertionError:  { exception_description }
    """
    df = pd.read_csv(
        os.path.join(os.path.dirname(__file__), 'data', 'Freedman.csv'))
    check = Check()
    assert check.is_categorical(df['Location']) == True
Пример #2
0
def test_is_working():
    check = Check()
    print(check.is_working())
Пример #3
0
def test_sum_three():
    assert Check.sum(100, 100) == 200
Пример #4
0
def test_sum_two():
    assert Check.sum(100, 200) != 30
Пример #5
0
def test_sum_one():
    assert Check.sum(10, 20) == 30
Пример #6
0
def test_is_not_continuous_2():
    df = pd.read_csv(
        os.path.join(os.path.dirname(__file__), 'data', 'Freedman.csv'))
    check = Check()
    assert check.is_continuous(df['population']) == False
Пример #7
0
def test_is_not_continuous():
    df = pd.read_csv(
        os.path.join(os.path.dirname(__file__), 'data', 'Freedman.csv'))
    check = Check()
    assert check.is_continuous(df['nonwhite']) == True
Пример #8
0
def test_is_not_categorical_1():
    df = pd.read_csv(
        os.path.join(os.path.dirname(__file__), 'data', 'Freedman.csv'))
    check = Check()
    assert check.is_categorical(df['density']) == False