test_data   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 26
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Functions

Rating   Name   Duplication   Size   Complexity  
A test_list_datasets() 0 4 1
A test_load_boston() 0 11 1
A test_load_iris() 0 9 1
1
2
from apoor import data
3
4
5
def test_list_datasets():
6
    d = data.list_datasets()
7
    assert "iris" in d
8
    assert "boston" in d
9
10
def test_load_iris():
11
    df = data.load_iris()
12
    iris_shape = (150, 5)
13
    assert df.shape == iris_shape
14
    iris_cols = [
15
        'sepal_length','sepal_width', 
16
        'petal_length','petal_width', 
17
        'target']
18
    assert df.columns.to_list() == iris_cols
19
    
20
def test_load_boston():
21
    df = data.load_boston()
22
    boston_shape = (506, 14)
23
    assert df.shape == boston_shape
24
    boston_cols = [
25
        'CRIM','ZN','INDUS',
26
        'CHAS','NOX','RM',
27
        'AGE','DIS','RAD','TAX',
28
        'PTRATIO','B','LSTAT',
29
        'MEDV']
30
    assert df.columns.to_list() == boston_cols
31
32