Skip to content
Snippets Groups Projects
Commit 6e754bac authored by lukas leufen's avatar lukas leufen
Browse files

adjusted tests

parent c574d728
Branches
Tags
2 merge requests!9new version v0.2.0,!8data generator
Pipeline #25666 passed
......@@ -55,3 +55,4 @@ Thumbs.db
htmlcov/
.pytest_cache
/test/data/
report.html
......@@ -13,10 +13,11 @@ class TestDataGenerator:
@pytest.fixture
def gen(self):
return DataGenerator('data', 'UBA', 'DEBW107', ['o3', 'temp'], 'datetime', 'variables', 'o3')
return DataGenerator(os.path.join(os.path.dirname(__file__), 'data'), 'UBA', 'DEBW107', ['o3', 'temp'],
'datetime', 'variables', 'o3')
def test_init(self, gen):
assert gen.path == os.path.abspath('data')
assert gen.path == os.path.join(os.path.dirname(__file__), 'data')
assert gen.network == 'UBA'
assert gen.stations == ['DEBW107']
assert gen.variables == ['o3', 'temp']
......
......@@ -13,8 +13,8 @@ class TestDataPrep:
@pytest.fixture
def data(self):
return DataPrep('test/data/', 'dummy', 'DEBW107', ['o3', 'temp'], test='testKWARGS',
statistics_per_var={'o3': 'dma8eu', 'temp': 'maximum'})
return DataPrep(os.path.join(os.path.dirname(__file__), 'data'), 'dummy', 'DEBW107', ['o3', 'temp'],
test='testKWARGS', statistics_per_var={'o3': 'dma8eu', 'temp': 'maximum'})
def test_init(self, data):
assert data.path == os.path.join(os.path.abspath(os.path.dirname(__file__)), 'data')
......@@ -41,13 +41,13 @@ class TestDataPrep:
def test_set_file_name_and_meta(self):
d = object.__new__(DataPrep)
d.path = os.path.abspath('test/data/test')
d.path = os.path.abspath('test/data/')
d.station = 'TESTSTATION'
d.variables = ['a', 'bc']
assert d._set_file_name() == os.path.join(os.path.abspath(os.path.dirname(__file__)),
"data/test/TESTSTATION_a_bc.nc")
"data/TESTSTATION_a_bc.nc")
assert d._set_meta_file_name() == os.path.join(os.path.abspath(os.path.dirname(__file__)),
"data/test/TESTSTATION_a_bc_meta.csv")
"data/TESTSTATION_a_bc_meta.csv")
@pytest.mark.parametrize('opts', [{'dim': 'datetime', 'method': 'nearest', 'limit': 10, 'use_coordinate': True},
{'dim': 'datetime', 'limit': 5}, {'dim': 'datetime'}])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment