Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robbibt committed Dec 20, 2023
1 parent 47b9bcc commit cd184fd
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 9 deletions.
4 changes: 0 additions & 4 deletions intertidal/elevation.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@
from intertidal.tidal_bias_offset import bias_offset, tidal_offset_tidelines


def sample_func(a):
return a


def extract_geobox(
study_area=None,
geom=None,
Expand Down
Binary file added tests/data/satellite_ds.pickle
Binary file not shown.
34 changes: 29 additions & 5 deletions tests/test_intertidal.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import pytest
from click.testing import CliRunner
from intertidal.elevation import intertidal_cli, sample_func
from intertidal.elevation import intertidal_cli


@pytest.fixture()
def satellite_ds():
with open("tests/data/satellite_ds.pickle", "rb") as handle:
return pickle.load(handle)


@pytest.mark.dependency()
def test_intertidal_cli():
runner = CliRunner()
result = runner.invoke(
Expand All @@ -13,7 +18,26 @@ def test_intertidal_cli():
],
)
assert result.exit_code == 0



def test_sample_func():
assert sample_func(1) == 1
def test_elevation(satellite_ds):

ds, ds_aux, tide_m = elevation(
satellite_ds,
valid_mask=None,
ndwi_thresh=0.1,
min_freq=0.01,
max_freq=0.99,
min_correlation=0.15,
windows_n=20,
window_prop_tide=0.15,
max_workers=None,
tide_model="FES2014",
tide_model_dir="/var/share/tide_models",
study_area=None,
log=None,
)

assert "time" not in ds.dims
assert "elevation" in ds.data_vars
assert "elevation_uncertainty" in ds.data_vars

0 comments on commit cd184fd

Please sign in to comment.