From b0d35f286b89eb7aef2ea9a0b62eea60b3bcda28 Mon Sep 17 00:00:00 2001 From: Olzhas Arystanov Date: Mon, 6 May 2024 23:21:13 +0500 Subject: [PATCH] Fix typing --- app/src/bittensor_panel/core/bt.py | 2 +- app/src/bittensor_panel/core/tests/test_admin.py | 4 ++-- app/src/bittensor_panel/core/tests/test_bt.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/bittensor_panel/core/bt.py b/app/src/bittensor_panel/core/bt.py index ea8b028..b328b6b 100644 --- a/app/src/bittensor_panel/core/bt.py +++ b/app/src/bittensor_panel/core/bt.py @@ -37,7 +37,7 @@ def load_hyperparams() -> dict[str, int] | None: return asdict(hyperparams) -def update_remote_hyperparam(name: str, value: int) -> bool: +def update_remote_hyperparam(name: str, value: str) -> bool: st = get_subtensor() wallet = get_wallet() diff --git a/app/src/bittensor_panel/core/tests/test_admin.py b/app/src/bittensor_panel/core/tests/test_admin.py index 3b12cbb..2da4cbb 100644 --- a/app/src/bittensor_panel/core/tests/test_admin.py +++ b/app/src/bittensor_panel/core/tests/test_admin.py @@ -18,7 +18,7 @@ def test_refresh_hyperparams_view(admin_client: Client, mock_refresh_hyperparams mock_refresh_hyperparams.assert_called_once() assert response.status_code == 302 - assert response.url == "/admin/core/hyperparameter/" + assert response.url == "/admin/core/hyperparameter/" # type: ignore def test_refresh_hyperparams_view_exception(admin_client: Client, mock_refresh_hyperparams: MagicMock): @@ -27,4 +27,4 @@ def test_refresh_hyperparams_view_exception(admin_client: Client, mock_refresh_h response = admin_client.post("/admin/core/hyperparameter/refresh-hyperparams/") assert response.status_code == 302 - assert response.url == "/admin/core/hyperparameter/" + assert response.url == "/admin/core/hyperparameter/" # type: ignore diff --git a/app/src/bittensor_panel/core/tests/test_bt.py b/app/src/bittensor_panel/core/tests/test_bt.py index e35b75d..c16a928 100644 --- a/app/src/bittensor_panel/core/tests/test_bt.py +++ b/app/src/bittensor_panel/core/tests/test_bt.py @@ -118,7 +118,7 @@ def test_update_remote_hyperparam(mock_subtensor: MagicMock, mock_wallet: MagicM mock_subtensor.return_value.set_hyperparameter.return_value = result name = "difficulty" - value = 10 + value = "10" assert bt.update_remote_hyperparam(name, value) == result @@ -137,4 +137,4 @@ def test_update_remote_hyperparam_exception(mock_subtensor: MagicMock, mock_wall mock_subtensor.return_value.set_hyperparameter.side_effect = RuntimeError with pytest.raises(SubtensorServerError): - bt.update_remote_hyperparam("difficulty", 10) + bt.update_remote_hyperparam("difficulty", "10")