You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Listing functions when not enough results are available #580
It occured to me that the listing function goes bananas when there are less results available that we wanted to obtain.
I extended the unit test of test_utils.py:
class OpenMLTaskTest(TestBase):
def mocked_perform_api_call(call):
# TODO: JvR: Why is this not a staticmethod?
url = openml.config.server + '/' + call
return openml._api_calls._read_url(url)
@mock.patch('openml._api_calls._perform_api_call', side_effect=mocked_perform_api_call)
def test_list_all_few_results_available(self, _perform_api_call):
# we want to make sure that the number of api calls is only 1.
# Although we have multiple versions of the iris dataset, there is only
# one with this name/version combination
datasets = openml.datasets.list_datasets(size=1000,
data_name='iris',
data_version=1)
self.assertEqual(len(datasets), 1)
self.assertEqual(_perform_api_call.call_count, 1)
Activity
Merge pull request #581 from openml/fix_#580
mfeurer commentedon Dec 3, 2018
Fixed by #581.