Skip to content

Commit 106a162

Browse files
chore: format conftest with black
Signed-off-by: SubhraSameerDash <[email protected]>
1 parent dce6220 commit 106a162

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

.github/workflows/pr-check-changelog.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: 'PR Changelog Check'
22

33
on:
4-
workflow_dispatch:
54
pull_request:
65
types: [opened, reopened, edited, synchronize]
76

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
1414
- Standardize formatting of `evm_address_test.py` using Black for improved consistency and readability (#1529)
1515
- Formatted unit test files using Black.
1616
- Format `tests/unit/network_tls_test.py` with black for code style consistency (#1543)
17+
- Format `tests/unit/conftest.py` with black for code style consistency. (#1544)
1718

1819
### Added
1920
- Added a beginner assignment guard that requires completion of a Good First Issue. (#1484)
@@ -193,6 +194,7 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
193194
- Updated `.github/scripts/bot-office-hours.sh` to detect and skip PRs created by bot accounts when posting office hours reminders. (#1384)
194195
- Refactored `examples/account/account_create_transaction_create_with_alias.py` and `examples/account/account_create_transaction_evm_alias.py` to use the native `AccountInfo.__str__` method for printing account details, replacing manual JSON serialization. ([#1263](https://github.com/hiero-ledger/hiero-sdk-python/issues/1263))
195196
- Enhance TopicInfo `__str__` method and tests with additional coverage, and update the format_key function in `key_format.py` to handle objects with a _to_proto method.
197+
- Update changelog workflow to trigger automatically on pull requests instead of manual dispatch (#1567)
196198

197199
### Fixed
198200
- Prevented linkbot from commenting on or auto-closing bot-authored pull requests. (#1516)

tests/unit/conftest.py

Lines changed: 21 additions & 4 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."""
46-
return [b'a']
55+
return [b"a"]
56+
4757

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)