Skip to content

Commit 2534698

Browse files
chore: format tests/unit/conftest.py with black #1522 (#1584)
Signed-off-by: SubhraSameerDash <[email protected]> Signed-off-by: Subhra Sameer Dash <[email protected]>
1 parent 8a69134 commit 2534698

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
99

1010

1111
### Tests
12+
13+
- Formatted `tests/unit/conftest.py` with black for code style consistency. (#1522)
1214
- format `black tests/unit/nft_id_test.py` with Black.(#1544)
1315
- Format `tests/unit/executable_test.py` with Black.(#1530)
1416
- Format `tests/unit/hedera_trust_manager_test.py` with Black for consistent code style (#1539)
@@ -132,6 +134,8 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
132134
- Add automated bot to recommend next issues to contributors after their first PR merge (#1380)
133135
- Added dry-run support and refactored `.github/workflows/bot-workflows.yml` to use dedicated script `.github/scripts/bot-workflows.js` for improved maintainability and testability. (`#1288`)
134136

137+
### Changed
138+
135139
### Documentation
136140
- Added comprehensive docstring to `compress_with_cryptography` function (#1626)
137141

tests/unit/conftest.py

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
FAKE_CERT_HASH = hashlib.sha384(FAKE_CERT_PEM).hexdigest().encode("utf-8")
2727

28+
2829
@pytest.fixture
2930
def 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
3947
def amount():
4048
"""Fixture to provide a default amount for fungible tokens."""
4149
return 1000
4250

51+
4352
@pytest.fixture
4453
def metadata():
4554
"""Fixture to provide mock metadata for NFTs."""
4655
return [b'a']
4756

57+
4858
@pytest.fixture
4959
def transaction_id():
5060
"""Fixture that generates a transaction ID for testing."""
5161
return TransactionId.generate(AccountId(0, 0, 1234))
5262

63+
5364
@pytest.fixture
5465
def private_key():
5566
"""Fixture to generate a private key for testing."""
5667
return PrivateKey.generate()
5768

69+
5870
@pytest.fixture
5971
def topic_id():
6072
"""Fixture to create a topic ID for testing."""
6173
return TopicId(0, 0, 1234)
6274

75+
6376
@pytest.fixture
6477
def 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
7185
def token_id():
7286
"""Fixture to provide a mock TokenId instance."""
7387
return TokenId(shard=0, realm=0, num=3)
7488

89+
7590
@pytest.fixture
7691
def file_id():
7792
"""Fixture to provide a mock FileId instance."""
7893
return FileId(shard=0, realm=0, file=2)
7994

95+
8096
@pytest.fixture
8197
def contract_id():
8298
"""Fixture to provide a mock ContractId instance."""
8399
return ContractId(shard=0, realm=0, contract=1)
84100

101+
85102
@pytest.fixture
86103
def 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

Comments
 (0)