Skip to content

Conversation

@Subhrasameerdash
Copy link
Contributor

Description:
Format node unit tests with Black for consistent style.

  • Run Black on tests/unit/node*.py

Related issue(s):

Fixes #1545

Notes for reviewer:

Checklist

Signed-off-by: SubhraSameerDash <2303105_cseai@gita.edu.in>
Signed-off-by: SubhraSameerDash <2303105_cseai@gita.edu.in>
Copilot AI review requested due to automatic review settings January 27, 2026 19:06
@github-actions
Copy link

Hi, this is MergeConflictBot.
Your pull request cannot be merged because it contains merge conflicts.

Please resolve these conflicts locally and push the changes.

To assist you, please read:

Thank you for contributing!

@Subhrasameerdash Subhrasameerdash changed the title Chore/format node tests black chore/format node tests black Jan 27, 2026
Signed-off-by: Subhra Sameer Dash <170787407+Subhrasameerdash@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR formats node unit test files using Black to ensure consistent code style across the test suite, addressing issue #1545.

Changes:

  • Applied Black formatting to four node-related test files (node_update_transaction_test.py, node_tls_test.py, node_create_transaction_test.py, node_address_test.py)
  • Updated CHANGELOG.md to document the formatting changes

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/unit/node_update_transaction_test.py Reformatted assertions to split long lines for better readability
tests/unit/node_tls_test.py Applied Black formatting including line breaks, spacing, and quote consistency; includes one regex pattern fix
tests/unit/node_create_transaction_test.py Reformatted long assertion lines for improved readability
tests/unit/node_address_test.py Reformatted imports, function calls, and added consistent blank lines
CHANGELOG.md Added changelog entry documenting the formatting changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

with pytest.raises(ValueError, match="No certificate available."):

with pytest.raises(ValueError, match=r"No certificate available\."):
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line contains a non-formatting change. The original code had match="No certificate available." which has been changed to match=r"No certificate available\.". This adds a raw string prefix and escapes the period in the regex pattern. While this is technically a bug fix (the period should be escaped in regex), it goes beyond the stated scope of this PR which is to "format node unit tests with Black for consistent style." Black does not modify the content of strings or add raw string prefixes to fix regex patterns.

This change should either be:

  1. Documented in the PR description as an additional bug fix
  2. Separated into a different commit/PR that focuses on the bug fix
  3. Reverted to match the original code if this PR should only contain formatting changes

Copilot uses AI. Check for mistakes.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

Walkthrough

Applied Black formatting to node-related unit tests and updated the changelog; additionally, explicit assertions were added to tests/unit/node_update_transaction_test.py. No API, control-flow, or exported/public declaration changes.

Changes

Cohort / File(s) Summary
Changelog entry
CHANGELOG.md
Added an Unreleased test changelog entry noting Black formatting of tests/unit/node*.py (issue #1545).
Node unit test formatting
tests/unit/node_address_test.py, tests/unit/node_create_transaction_test.py, tests/unit/node_tls_test.py
Stylistic reformatting by Black: reflowed imports/arguments, standardized quotes, added trailing commas and parentheses, and whitespace adjustments. No behavior or logic changes.
Node update transaction tests
tests/unit/node_update_transaction_test.py
Reflowed assertions and added explicit assertions verifying gossip_ca_certificate.value and grpc_certificate_hash.value match node_params in both test_build_transaction_body and test_build_scheduled_body. No control-flow or API changes.

Sequence Diagram(s)

(Skipped — changes are formatting and small test-assertion additions that do not introduce new multi-component control flow.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'chore/format node tests black' accurately and concisely describes the main change: formatting node unit tests with Black.
Description check ✅ Passed The PR description directly relates to the changeset, explaining that node unit tests are being formatted with Black and referencing the related issue #1545.
Linked Issues check ✅ Passed The PR fulfills the core objective of issue #1545: formatting tests/unit/node*.py with Black. A changelog entry was added and the changes are purely formatting-focused as required.
Out of Scope Changes check ✅ Passed All changes are scoped to formatting node unit tests with Black. The modifications are purely stylistic (import organization, quote consistency, whitespace, trailing commas) with no functional logic changes or unrelated alterations.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

CHANGELOG.md Outdated
Comment on lines 19 to 22
- Improve unit test coverage for `Hbar`, including edge cases, validation, comparisons, and hashing. (#1483)
- Standardize formatting of `evm_address_test.py` using Black for improved consistency and readability (#1529)
- Improve unit test coverage for Hbar, including edge cases, validation, comparisons, and hashing. (#1483)
- Standardize formatting of evm_address_test.py using Black for improved consistency and readability (#1529)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove duplicate changelog entries.

Lines 19-20 are duplicated in lines 21-22. This creates redundant entries that reduce changelog clarity. Lines 19-20 use proper formatting with backticks around code identifiers (`Hbar` and `evm_address_test.py`), while lines 21-22 lack this formatting.

🔧 Proposed fix: Remove duplicate entries

Remove lines 21-22 as they duplicate the properly formatted entries on lines 19-20:

 - Formatted node unit test files with Black (`#1545`)
 - Improve unit test coverage for `Hbar`, including edge cases, validation, comparisons, and hashing. (`#1483`)
 - Standardize formatting of `evm_address_test.py` using Black for improved consistency and readability (`#1529`)
-- Improve unit test coverage for Hbar, including edge cases, validation, comparisons, and hashing. (`#1483`)
-- Standardize formatting of evm_address_test.py using Black for improved consistency and readability (`#1529`)
 - Formatted unit test files using Black.

Signed-off-by: SubhraSameerDash <2303105_cseai@gita.edu.in>
Signed-off-by: SubhraSameerDash <2303105_cseai@gita.edu.in>
@Subhrasameerdash
Copy link
Contributor Author

Subhrasameerdash commented Jan 27, 2026

Hii @manishdait in the last PR I made some mistakes while creating the branch, so this is the new one

Can you help me resolve the 2 failed checks

Signed-off-by: SubhraSameerDash <2303105_cseai@gita.edu.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Good First Issue]: format black tests/unit/node*.py

1 participant