From ca6908d0e952579e52754bd0ec595a67995a1cf7 Mon Sep 17 00:00:00 2001 From: Erik van Onselen Date: Wed, 20 Mar 2024 13:54:35 +0100 Subject: [PATCH] Added test for inverted slice_by_values --- tests/test_pointcollection.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_pointcollection.py b/tests/test_pointcollection.py index 3b713a1..5803bb7 100644 --- a/tests/test_pointcollection.py +++ b/tests/test_pointcollection.py @@ -237,6 +237,22 @@ def test_slice_by_values(self, boreholes): assert len(layers_v_z.data) == 23 assert len(layers_v_z.header) == 11 + @pytest.mark.unittest + def test_inverted_slice_by_values(self, boreholes): + layers_non_k = boreholes.slice_by_values("lith", "K", invert=True) + layers_non_ks2 = boreholes.slice_by_values("lith_comb", "Ks2", invert=True) + layers_non_h2 = boreholes.slice_by_values("org", "H2", invert=True) + layers_non_v_z = boreholes.slice_by_values("lith", ["V", "Z"], invert=True) + + assert len(layers_non_k.data) == 162 + assert len(layers_non_k.header) == 13 + assert len(layers_non_ks2.data) == 331 + assert len(layers_non_ks2.header) == 13 + assert len(layers_non_h2.data) == 347 + assert len(layers_non_h2.header) == 13 + assert len(layers_non_v_z.data) == 327 + assert len(layers_non_v_z.header) == 13 + @pytest.mark.integrationtest def test_validation_pass(self, capfd, borehole_df_ok): BoreholeCollection(borehole_df_ok)