Skip to content

Commit

Permalink
test: updates
Browse files Browse the repository at this point in the history
  • Loading branch information
alambare committed Aug 29, 2023
1 parent 4aa6f75 commit 2c6c535
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions eodag/api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ def _search_by_id(self, uid, provider=None, **kwargs):

def _prepare_search(
self, start=None, end=None, geom=None, locations=None, provider=None, **kwargs
) -> Tuple[List[Search], Dict[str, Any]]:
) :
"""Internal method to prepare the search kwargs and get the search plugins.
Product query:
Expand Down Expand Up @@ -1404,7 +1404,7 @@ def _prepare_search(
)
self.fetch_product_types_list()

search_plugins = []
search_plugins: List[Search] = []
for plugin in self._plugins_manager.get_search_plugins(
product_type=product_type
):
Expand Down
10 changes: 5 additions & 5 deletions tests/units/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1661,7 +1661,7 @@ class DummyConfig:
pagination = {}

search_plugin.config = DummyConfig()
prepare_seach.return_value = dict(search_plugin=search_plugin)
prepare_seach.return_value = ([search_plugin], {})
page_iterator = self.dag.search_iter_page_plugin(
items_per_page=2, search_plugin=search_plugin
)
Expand All @@ -1688,7 +1688,7 @@ class DummyConfig:
pagination = {}

search_plugin.config = DummyConfig()
prepare_seach.return_value = dict(search_plugin=search_plugin)
prepare_seach.return_value = ([search_plugin], {})
page_iterator = self.dag.search_iter_page_plugin(
items_per_page=2, search_plugin=search_plugin
)
Expand All @@ -1713,7 +1713,7 @@ class DummyConfig:
pagination = {}

search_plugin.config = DummyConfig()
prepare_seach.return_value = dict(search_plugin=search_plugin)
prepare_seach.return_value = ([search_plugin], {})
page_iterator = self.dag.search_iter_page_plugin(
items_per_page=2, search_plugin=search_plugin
)
Expand All @@ -1729,7 +1729,7 @@ def test_search_iter_page_does_not_handle_query_errors(
"""search_iter_page must propagate errors"""
search_plugin.provider = "peps"
search_plugin.query.side_effect = AttributeError()
prepare_seach.return_value = dict(search_plugin=search_plugin)
prepare_seach.return_value = ([search_plugin], {})
page_iterator = self.dag.search_iter_page_plugin()
with self.assertRaises(AttributeError):
next(page_iterator)
Expand Down Expand Up @@ -1805,7 +1805,7 @@ class DummyConfig:
# mocked return value. Later calls would then break
def yield_search_plugin():
while True:
yield {"search_plugins": [search_plugin]}
yield ([search_plugin], {})

prepare_seach.side_effect = yield_search_plugin()
all_results = self.dag.search_all(items_per_page=2)
Expand Down

0 comments on commit 2c6c535

Please sign in to comment.