-
-
Notifications
You must be signed in to change notification settings - Fork 246
fixes empty listing bug #405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,3 +63,10 @@ def test_evaluation_list_limit(self): | |
|
|
||
| evaluations = openml.evaluations.list_evaluations("predictive_accuracy", size=100, offset=100) | ||
| self.assertEquals(len(evaluations), 100) | ||
|
|
||
| def test_list_evaluations_empty(self): | ||
| evaluations = openml.evaluations.list_evaluations('unexisting_measure') | ||
| if len(evaluations) > 0: | ||
| raise ValueError('UnitTest Outdated, got somehow results') | ||
|
|
||
| self.assertIsInstance(evaluations, dict) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -830,6 +830,13 @@ def test_get_runs_list(self): | |
| for rid in runs: | ||
| self._check_run(runs[rid]) | ||
|
|
||
| def test_list_runs_empty(self): | ||
| runs = openml.runs.list_runs(task=[-1]) | ||
| if len(runs) > 0: | ||
| raise ValueError('UnitTest Outdated, got somehow results') | ||
|
|
||
| self.assertIsInstance(runs, dict) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
|
|
||
| def test_get_runs_list_by_task(self): | ||
| # TODO: comes from live, no such lists on test | ||
| openml.config.server = self.production_server | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -137,6 +137,13 @@ def test_setup_list_filter_flow(self): | |
| for setup_id in setups.keys(): | ||
| self.assertEquals(setups[setup_id].flow_id, flow_id) | ||
|
|
||
| def test_list_setups_empty(self): | ||
| setups = openml.setups.list_setups(setup=[-1]) | ||
| if len(setups) > 0: | ||
| raise ValueError('UnitTest Outdated, got somehow results') | ||
|
|
||
| self.assertIsInstance(setups, dict) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
|
|
||
| def test_setuplist_offset(self): | ||
| # TODO: remove after pull on live for better testing | ||
| # openml.config.server = self.production_server | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,13 @@ def test_list_tasks_by_type(self): | |
| self.assertEquals(ttid, tasks[tid]["ttid"]) | ||
| self._check_task(tasks[tid]) | ||
|
|
||
| def test_list_tasks_empty(self): | ||
| tasks = openml.tasks.list_tasks(tag='NoOneWillEverUseThisTag') | ||
| if len(tasks) > 0: | ||
| raise ValueError('UnitTest Outdated, got somehow results (tag is used, please adapt)') | ||
|
|
||
| self.assertIsInstance(tasks, dict) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
|
|
||
| def test_list_tasks_by_tag(self): | ||
| num_basic_tasks = 100 # number is flexible, check server if fails | ||
| tasks = openml.tasks.list_tasks(tag='study_14') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should also check that the dictionary is actually empty.