| Total Complexity | 3 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 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 |