Skip to content

Commit

Permalink
added meuse test
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaelicke committed Jun 2, 2021
1 parent d1b3ede commit 3b810e7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions skgstat/tests/test_data_loader.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pytest

from skgstat import data
import numpy as np
from numpy.testing import assert_array_almost_equal
Expand Down Expand Up @@ -40,3 +42,20 @@ def test_aniso_data():

c, v = data.aniso(N=25).get('sample')
assert len(c) == len(v) == 25


def test_meuse_loads():
df = data._loader.read_sample_file('meuse.txt')

# get zinc data
_, zinc = data.meuse(variable='zinc').get('sample')

assert_array_almost_equal(
zinc, df[['zinc']].values, decimal=6
)

# check exeption
with pytest.raises(AttributeError) as e:
data.meuse(variable='unknown')

assert 'variable has to be in' in str(e.value)

0 comments on commit 3b810e7

Please sign in to comment.