Skip to content

Commit

Permalink
Check that missing pytroll-schedule emits log message
Browse files Browse the repository at this point in the history
  • Loading branch information
lahtinep committed Nov 15, 2024
1 parent c6fc9e9 commit 07023a7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions trollflow2/tests/test_trollflow2.py
Original file line number Diff line number Diff line change
Expand Up @@ -2215,6 +2215,22 @@ def test_valid_filter_zero_coverage(caplog, sc_3a_3b):
assert "IR037" not in prods


def test_valid_filter_no_trollsched(caplog, monkeypatch, sc_3a_3b):
"""Test filter for minimum fraction of valid data with full coverage."""
monkeypatch.setattr("trollsched.spherical.get_twilight_poly", None)
from trollflow2.plugins import check_valid_data_fraction

job, prods = _create_valid_filter_job_and_prods(sc_3a_3b)

with mock.patch("trollflow2.plugins._get_scene_coverage") as tpg, \
caplog.at_level(logging.DEBUG):
tpg.return_value = 100
check_valid_data_fraction(job)

assert "Trollsched import failed" in caplog.text
assert "Keeping all products" in caplog.text


def _create_valid_filter_job_and_prods(sc_3a_3b):
from trollflow2.launcher import yaml
product_list = yaml.safe_load(yaml_test3)
Expand Down

0 comments on commit 07023a7

Please sign in to comment.