Skip to content

Commit

Permalink
Skip tests if earthranger doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Yun-Wu committed Nov 4, 2023
1 parent 47b6ca9 commit c9dccf2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,4 @@ doc/source/_autosummary
doc/source/notebooks
tags
Ecoscope-Outputs
tests/test_output/new.html
4 changes: 4 additions & 0 deletions tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
import ecoscope


@pytest.mark.skipif(not pytest.earthranger, reason="No connection to EarthRanger")
def test_trajectory_is_not_empty(er_io):
# test there is actually data in trajectory
relocations = er_io.get_subjectgroup_observations(group_name=er_io.GROUP_NAME)
trajectory = ecoscope.base.Trajectory.from_relocations(relocations)
assert not trajectory.empty


@pytest.mark.skipif(not pytest.earthranger, reason="No connection to EarthRanger")
def test_redundant_columns_in_trajectory(er_io):
# test there is no redundant column in trajectory
relocations = er_io.get_subjectgroup_observations(group_name=er_io.GROUP_NAME)
Expand All @@ -32,6 +34,7 @@ def test_relocs_speedfilter(er_io):
assert relocations.shape[0] != relocs_after_filter.shape[0]


@pytest.mark.skipif(not pytest.earthranger, reason="No connection to EarthRanger")
def test_relocs_distancefilter(er_io):
relocations = er_io.get_subjectgroup_observations(group_name=er_io.GROUP_NAME)
relocs_speed_filter = ecoscope.base.RelocsDistFilter(min_dist_km=1.0, max_dist_km=6.0)
Expand All @@ -40,6 +43,7 @@ def test_relocs_distancefilter(er_io):
assert relocations.shape[0] != relocs_after_filter.shape[0]


@pytest.mark.skipif(not pytest.earthranger, reason="No connection to EarthRanger")
def test_relocations_from_gdf_preserve_fields(er_io):
relocations = er_io.get_subjectgroup_observations(group_name=er_io.GROUP_NAME)
gpd.testing.assert_geodataframe_equal(relocations, ecoscope.base.Relocations.from_gdf(relocations))
Expand Down

0 comments on commit c9dccf2

Please sign in to comment.