diff --git a/trollsched/shapefiles_from_schedule.py b/trollsched/shapefiles_from_schedule.py index 3e9aea5..13092d8 100644 --- a/trollsched/shapefiles_from_schedule.py +++ b/trollsched/shapefiles_from_schedule.py @@ -143,7 +143,7 @@ def parse_args(args): "verbose logging). WARN=0, INFO=1, " "DEBUG=2. This is overridden by the log config file if specified.") - return parser.parse_args() + return parser.parse_args(args) def run(args=None): diff --git a/trollsched/tests/test_pass_outlines.py b/trollsched/tests/test_pass_outlines.py index 8b8be8b..aae2e74 100644 --- a/trollsched/tests/test_pass_outlines.py +++ b/trollsched/tests/test_pass_outlines.py @@ -28,7 +28,7 @@ create_shapefile_filename, create_shapefile_from_pass, get_shapely_polygon_from_lonlat, - shapefiles_from_schedule_xml_requests, + run, ) CONT_POLY_LON = np.array([-2.13452262, -2.29587336, -2.71901413, 2.49884179, 1.84466852, @@ -97,13 +97,15 @@ def test_create_shapefile_from_pass(fake_noaa20_viirs_pass_instance, tmp_path): @pytest.mark.usefixtures("fake_long_tle_file") @pytest.mark.usefixtures("fake_xml_schedule_file") -def test_shapefiles_from_schedule_xml_requests(fake_xml_schedule_file, fake_long_tle_file, tmp_path): - """Test create shapefiles from an xml schedule request file.""" +def test_create_shapefiles_from_schedule(fake_xml_schedule_file, fake_long_tle_file, tmp_path): + """Test running the script to create shapefiles from an xml schedule request file.""" output_dir = tmp_path / "results" output_dir.mkdir() - satellites = ["Suomi NPP", "NOAA 18", "NOAA-20"] - shapefiles_from_schedule_xml_requests(str(fake_xml_schedule_file), satellites, - str(fake_long_tle_file), str(output_dir)) + + args = ["-s", "Suomi NPP", "NOAA 18", "NOAA-20", "-t", str(fake_long_tle_file), + "-x", str(fake_xml_schedule_file), + "-o", str(output_dir)] + run(args) n18files = [str(name) for name in output_dir.glob("avhrr_NOAA-18_202412022201_202412022216_outline.*")] assert len(n18files) == 5