mirror of
https://github.com/wassname/optuna-dashboard.git
synced 2026-10-28 13:11:26 +08:00
fix by review
This commit is contained in:
1 parent
7a97d3db5a
commit
1d7d5a7252
5 files changed
+52
-12
No files matched your search
@@ -157,6 +157,30 @@ class APITestCase(TestCase):
|
||||
assert better.number == 2
|
||||
assert worse.number == 1
|
||||
|
||||
def test_report_preference_when_typo_mode(self) -> None:
|
||||
storage = optuna.storages.InMemoryStorage()
|
||||
study = create_study(storage=storage)
|
||||
for _ in range(3):
|
||||
trial = study.ask()
|
||||
study.mark_comparison_ready(trial)
|
||||
|
||||
app = create_app(storage)
|
||||
study_id = study._study._study_id
|
||||
status, _, _ = send_request(
|
||||
app,
|
||||
f"/api/studies/{study_id}/preference",
|
||||
"POST",
|
||||
body=json.dumps(
|
||||
{
|
||||
"mode": "ChoseWorst",
|
||||
"candidates": [0, 1, 2],
|
||||
"clicked": 1,
|
||||
}
|
||||
),
|
||||
content_type="application/json",
|
||||
)
|
||||
self.assertEqual(status, 400)
|
||||
|
||||
def test_skip_trial(self) -> None:
|
||||
storage = optuna.storages.InMemoryStorage()
|
||||
study = create_study(storage=storage)
|
||||
|
||||
Reference in new issue
Block a user