Skip to content

Commit c744af3

Browse files
fixing magicmock
Signed-off-by: tech0priyanshu <priyanshuyadv101106@gmail.com>
1 parent 62624c0 commit c744af3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

tests/unit/fee_estimate_query_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ def test_port_replacement_for_localhost_execute_single():
338338
"""Test localhost:38081 is replaced with :8084."""
339339
client_1 = MagicMock()
340340
client_1.network.get_mirror_rest_url.return_value = "http://localhost:38081/api/v1"
341+
client_1.default_max_transaction_fee = Hbar(1)
341342

342343
tx = (
343344
TransferTransaction()
@@ -355,6 +356,7 @@ def test_port_replacement_for_localhost_execute_single():
355356

356357
client_2 = MagicMock()
357358
client_2.network.get_mirror_rest_url.return_value = "http://127.0.0.1:38081/api/v1"
359+
client_2.default_max_transaction_fee = Hbar(1)
358360

359361
with patch.object(query, "_execute_single") as mock_execute_single:
360362
query.execute(client_2)
@@ -367,6 +369,7 @@ def test_port_replacement_for_localhost_execute_multiple():
367369
"""Test localhost:38081 is replaced with :8084 for chunked tx."""
368370
client_1 = MagicMock()
369371
client_1.network.get_mirror_rest_url.return_value = "http://localhost:38081/api/v1"
372+
client_1.default_max_transaction_fee = Hbar(1)
370373

371374
tx = (
372375
TopicMessageSubmitTransaction()
@@ -387,9 +390,11 @@ def test_port_replacement_for_localhost_execute_multiple():
387390

388391
client_2 = MagicMock()
389392
client_2.network.get_mirror_rest_url.return_value = "http://127.0.0.1:38081/api/v1"
393+
client_2.default_max_transaction_fee = Hbar(1)
390394

391395
with patch.object(query, "_execute_chunked", return_value=MagicMock()) as mock_execute_chunked:
392396
query.execute(client_2)
397+
393398
called_url = mock_execute_chunked.call_args[0][1]
394399
assert ":8084" in called_url
395400
assert ":38081" not in called_url

0 commit comments

Comments
 (0)