2525
2626FAKE_CERT_HASH = hashlib .sha384 (FAKE_CERT_PEM ).hexdigest ().encode ("utf-8" )
2727
28+
2829@pytest .fixture
2930def mock_account_ids ():
3031 """Fixture to provide mock account IDs and token IDs."""
@@ -33,66 +34,82 @@ def mock_account_ids():
3334 node_account_id = AccountId (0 , 0 , 3 )
3435 token_id_1 = TokenId (1 , 1 , 1 )
3536 token_id_2 = TokenId (2 , 2 , 2 )
36- return account_id_sender , account_id_recipient , node_account_id , token_id_1 , token_id_2
37+ return (
38+ account_id_sender ,
39+ account_id_recipient ,
40+ node_account_id ,
41+ token_id_1 ,
42+ token_id_2 ,
43+ )
44+
3745
3846@pytest .fixture
3947def amount ():
4048 """Fixture to provide a default amount for fungible tokens."""
4149 return 1000
4250
51+
4352@pytest .fixture
4453def metadata ():
4554 """Fixture to provide mock metadata for NFTs."""
46- return [b'a' ]
55+ return [b"a" ]
56+
4757
4858@pytest .fixture
4959def transaction_id ():
5060 """Fixture that generates a transaction ID for testing."""
5161 return TransactionId .generate (AccountId (0 , 0 , 1234 ))
5262
63+
5364@pytest .fixture
5465def private_key ():
5566 """Fixture to generate a private key for testing."""
5667 return PrivateKey .generate ()
5768
69+
5870@pytest .fixture
5971def topic_id ():
6072 """Fixture to create a topic ID for testing."""
6173 return TopicId (0 , 0 , 1234 )
6274
75+
6376@pytest .fixture
6477def nft_id ():
6578 """Fixture to provide a mock NftId instance."""
6679 token_id = TokenId (shard = 0 , realm = 0 , num = 1 )
6780 serial_number = 8
6881 return NftId (token_id = token_id , serial_number = serial_number )
6982
83+
7084@pytest .fixture
7185def token_id ():
7286 """Fixture to provide a mock TokenId instance."""
7387 return TokenId (shard = 0 , realm = 0 , num = 3 )
7488
89+
7590@pytest .fixture
7691def file_id ():
7792 """Fixture to provide a mock FileId instance."""
7893 return FileId (shard = 0 , realm = 0 , file = 2 )
7994
95+
8096@pytest .fixture
8197def contract_id ():
8298 """Fixture to provide a mock ContractId instance."""
8399 return ContractId (shard = 0 , realm = 0 , contract = 1 )
84100
101+
85102@pytest .fixture
86103def mock_client ():
87104 """Fixture to provide a mock client with hardcoded nodes for testing purposes."""
88105 # Mock Node
89106 node = _Node (
90107 AccountId (0 , 0 , 3 ),
91108 "node1.example.com:50211" ,
92- address_book = NodeAddress (cert_hash = FAKE_CERT_HASH , addresses = [])
109+ address_book = NodeAddress (cert_hash = FAKE_CERT_HASH , addresses = []),
93110 )
94111 node ._fetch_server_certificate_pem = lambda : FAKE_CERT_PEM
95-
112+
96113 nodes = [node ]
97114
98115 network = Network (nodes = nodes )
0 commit comments