Example #1
0
 def fetch_data(self) -> np.ndarray:
     if self.filters or self.count < 200_000:
         return api.get_items(self.key, self.count, self.start_index,
                              self.filters)
     else:
         return api.get_items_with_pool(self.key, self.count,
                                        self.start_index)
Example #2
0
def test_get_items_with_pool(mocker, count, start_index, expected_items):
    mocker.patch("arche.tools.api.get_source",
                 return_value=Source(source_items),
                 autospec=True)
    mocker.patch("arche.tools.api.helpers.cpus_count",
                 return_value=1,
                 autospec=True)
    assert api.get_items_with_pool("k", count, start_index) == expected_items