diff --git a/eodag/api/core.py b/eodag/api/core.py index 29f11a6cb..c20d4bfe7 100644 --- a/eodag/api/core.py +++ b/eodag/api/core.py @@ -787,6 +787,8 @@ def guess_product_type(self, **kwargs): :rtype: list[str] :raises: :class:`~eodag.utils.exceptions.NoMatchingProductType` """ + if kwargs.get("productType", None): + return [kwargs["productType"]] supported_params = { param for param in ( diff --git a/tests/units/test_core.py b/tests/units/test_core.py index eabc50d4b..9dacdfd54 100644 --- a/tests/units/test_core.py +++ b/tests/units/test_core.py @@ -1157,6 +1157,10 @@ def test_guess_product_type_with_kwargs(self): ] self.assertEqual(actual, expected) + # with product type specified + actual = self.dag.guess_product_type(productType="foo") + self.assertEqual(actual, ["foo"]) + def test_guess_product_type_without_kwargs(self): """guess_product_type must raise an exception when no kwargs are provided""" with self.assertRaises(NoMatchingProductType):