Skip to content

Commit 966b598

Browse files
committed
chore: added coderabbit suggesttions
Signed-off-by: Manish Dait <[email protected]>
1 parent 9969570 commit 966b598

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

tests/integration/account_id_population_e2e_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_populate_account_id_evm_address(env, evm_address):
9090

9191
account_id = transfer_receipt.children[0].account_id
9292

93-
# Wait for mirrornode to update
93+
# Wait for mirror_node to update
9494
time.sleep(5)
9595

9696
new_account_id = account_id.populate_evm_address(env.client)

tests/integration/contract_id_population_e2e_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def test_populate_contract_id_num(env):
5050
)
5151
assert contract_receipt.status == ResponseCode.SUCCESS
5252
contract_id_with_num = contract_receipt.contract_id
53+
5354
assert contract_id_with_num is not None
5455

5556
# Query contract info to get evm_address
@@ -58,11 +59,14 @@ def test_populate_contract_id_num(env):
5859
0, 0, info.contract_account_id
5960
)
6061

61-
# Wait for mirrornode to update
62+
# Wait for mirror_node to update
6263
time.sleep(5)
6364

6465
final_contract_id = contract_id_with_evm_addr.populate_contract_num(env.client)
6566

67+
# should not update
68+
assert contract_id_with_evm_addr.contract == 0
69+
6670
assert final_contract_id.shard == contract_id_with_num.shard
6771
assert final_contract_id.realm == contract_id_with_num.realm
6872
assert final_contract_id.contract == contract_id_with_num.contract

tests/unit/contract_id_test.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def test_from_string_for_valid_str(contract_str, expected):
7777

7878
contract_id = ContractId.from_string(contract_str)
7979

80+
assert isinstance(contract_id, ContractId)
8081
assert contract_id.shard == shard
8182
assert contract_id.realm == realm
8283
assert contract_id.contract == contract
@@ -151,6 +152,7 @@ def test_from_proto():
151152

152153
contract_id = ContractId._from_proto(proto)
153154

155+
assert isinstance(contract_id, ContractId)
154156
assert contract_id.shard == 1
155157
assert contract_id.realm == 2
156158
assert contract_id.contract == 3
@@ -168,6 +170,7 @@ def test_from_proto_with_evm_address():
168170

169171
contract_id = ContractId._from_proto(proto)
170172

173+
assert isinstance(contract_id, ContractId)
171174
assert contract_id.shard == 1
172175
assert contract_id.realm == 2
173176
assert contract_id.contract == 0
@@ -180,6 +183,7 @@ def test_from_proto_zero_values():
180183

181184
contract_id = ContractId._from_proto(proto)
182185

186+
assert isinstance(contract_id, ContractId)
183187
assert contract_id.shard == 0
184188
assert contract_id.realm == 0
185189
assert contract_id.contract == 0
@@ -314,14 +318,14 @@ def test_to_evm_address():
314318

315319

316320

317-
def test_str_representaion_with_checksum(client):
321+
def test_str_representation_with_checksum(client):
318322
"""Should return string representation with checksum"""
319323
contract_id = ContractId.from_string("0.0.1")
320324
assert contract_id.to_string_with_checksum(client) == "0.0.1-dfkxr"
321325

322326

323327

324-
def test_str_representaion_checksum_with_evm_address(client):
328+
def test_str_representation_checksum_with_evm_address(client):
325329
"""Should raise error on to_string_with_checksum is called when evm_address is set"""
326330
contract_id = ContractId.from_string("0.0.abcdef0123456789abcdef0123456789abcdef01")
327331

@@ -348,8 +352,8 @@ def test_validate_checksum_failure(client):
348352
contract_id.validate_checksum(client)
349353

350354

351-
def test_str_representaion_with_evm_address():
352-
"""Should return str represention with evm_address"""
355+
def test_str_representation_with_evm_address():
356+
"""Should return str representing with evm_address"""
353357
contract_id = ContractId.from_string("0.0.abcdef0123456789abcdef0123456789abcdef01")
354358
assert contract_id.__str__() == "0.0.abcdef0123456789abcdef0123456789abcdef01"
355359

@@ -382,6 +386,7 @@ def test_from_evm_address_valid_params(evm_address_str, expected):
382386

383387
contract_id = ContractId.from_evm_address(0, 0, evm_address_str)
384388

389+
assert isinstance(contract_id, ContractId)
385390
assert contract_id.shard == shard
386391
assert contract_id.realm == realm
387392
assert contract_id.contract == contract
@@ -495,7 +500,7 @@ def test_populate_contract_num_success(client):
495500
assert populated.evm_address == evm_address
496501

497502

498-
def test_populate_contract_num_invlid_response(client):
503+
def test_populate_contract_num_invalid_response(client):
499504
"""Should raise error when populating contract number invalid response."""
500505
evm_address = bytes.fromhex("abcdef0123456789abcdef0123456789abcdef01")
501506
contract_id = ContractId(shard=0, realm=0, evm_address=evm_address)

0 commit comments

Comments
 (0)