Skip to content

Commit ad4f680

Browse files
author
Roman
committed
correct patching (doesn't affect to another tests)
1 parent 9041739 commit ad4f680

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tests/unit_tests/test_async_subtensor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2970,10 +2970,10 @@ async def test_get_owned_hotkeys_happy_path(subtensor, mocker):
29702970
]
29712971
]
29722972
mocked_subtensor = mocker.AsyncMock(return_value=fake_hotkeys)
2973-
subtensor.substrate.query = mocked_subtensor
2973+
mocker.patch.object(subtensor.substrate, "query", new=mocked_subtensor)
29742974

29752975
mocked_decode_account_id = mocker.Mock()
2976-
async_subtensor.decode_account_id = mocked_decode_account_id
2976+
mocker.patch.object(async_subtensor, "decode_account_id", new=mocked_decode_account_id)
29772977

29782978
# Call
29792979
result = await subtensor.get_owned_hotkeys(fake_coldkey)
@@ -2996,7 +2996,7 @@ async def test_get_owned_hotkeys_return_empty(subtensor, mocker):
29962996
# Prep
29972997
fake_coldkey = "fake_hotkey"
29982998
mocked_subtensor = mocker.AsyncMock(return_value=[])
2999-
subtensor.substrate.query = mocked_subtensor
2999+
mocker.patch.object(subtensor.substrate, "query", new=mocked_subtensor)
30003000

30013001
# Call
30023002
result = await subtensor.get_owned_hotkeys(fake_coldkey)

tests/unit_tests/test_subtensor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3345,10 +3345,10 @@ def test_get_owned_hotkeys_happy_path(subtensor, mocker):
33453345
]
33463346
]
33473347
mocked_subtensor = mocker.Mock(return_value=fake_hotkeys)
3348-
subtensor.substrate.query = mocked_subtensor
3348+
mocker.patch.object(subtensor.substrate, "query", new=mocked_subtensor)
33493349

33503350
mocked_decode_account_id = mocker.Mock()
3351-
subtensor_module.decode_account_id = mocked_decode_account_id
3351+
mocker.patch.object(subtensor_module, "decode_account_id", new=mocked_decode_account_id)
33523352

33533353
# Call
33543354
result = subtensor.get_owned_hotkeys(fake_coldkey)
@@ -3370,7 +3370,7 @@ def test_get_owned_hotkeys_return_empty(subtensor, mocker):
33703370
# Prep
33713371
fake_coldkey = "fake_hotkey"
33723372
mocked_subtensor = mocker.Mock(return_value=[])
3373-
subtensor.substrate.query = mocked_subtensor
3373+
mocker.patch.object(subtensor.substrate, "query", new=mocked_subtensor)
33743374

33753375
# Call
33763376
result = subtensor.get_owned_hotkeys(fake_coldkey)

0 commit comments

Comments
 (0)