Skip to content

Commit 63cc1b9

Browse files
authored
chore: format evm address unit tests with black (hiero-ledger#1536)
Signed-off-by: Kunal Siyag <kunalsiyag@rediffmail.com> Signed-off-by: K.S. <110692325+KunalSiyag@users.noreply.github.com>
1 parent 058017f commit 63cc1b9

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ This changelog is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.
1111
### Tests
1212
- Format account test files with Black (#1519)
1313
- Improve unit test coverage for `Hbar`, including edge cases, validation, comparisons, and hashing. (#1483)
14+
- Standardize formatting of `evm_address_test.py` using Black for improved consistency and readability (#1529)
15+
- Formatted unit test files using Black.
1416
- Format `tests/unit/network_tls_test.py` with black for code style consistency (#1543)
1517

1618
### Added

tests/unit/evm_address_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
pytestmark = pytest.mark.unit
55

6+
67
def test_from_string_without_prefix():
78
"""Test creating EvmAddress from valid 40-character hex string."""
89
hex_str = "1234567890abcdef1234567890abcdef12345678"
@@ -12,6 +13,7 @@ def test_from_string_without_prefix():
1213
assert addr.to_string() == hex_str
1314
assert len(addr.address_bytes) == 20
1415

16+
1517
def test_from_string_with_0x_prefix():
1618
"""Test creating EvmAddress from valid hex string with '0x' prefix."""
1719
hex_str = "0x1234567890abcdef1234567890abcdef12345678"
@@ -21,16 +23,19 @@ def test_from_string_with_0x_prefix():
2123
assert addr.to_string() == hex_str[2:]
2224
assert len(addr.address_bytes) == 20
2325

26+
2427
def test_from_string_invalid_length():
2528
"""Test ValueError for invalid hex string length."""
2629
with pytest.raises(ValueError):
2730
EvmAddress.from_string("0x1234")
2831

32+
2933
def test_from_string_invalid_hex_characters():
3034
"""Test ValueError for invalid hex characters."""
3135
with pytest.raises(ValueError):
3236
EvmAddress.from_string("0xZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ")
3337

38+
3439
def test_from_bytes_valid():
3540
"""Test creating EvmAddress from 20 bytes."""
3641
raw = bytes(range(20))
@@ -40,11 +45,13 @@ def test_from_bytes_valid():
4045
assert addr.address_bytes == raw
4146
assert addr.to_string() == raw.hex()
4247

48+
4349
def test_from_bytes_invalid_length():
4450
"""Test ValueError for byte length not equal to 20."""
4551
with pytest.raises(ValueError):
4652
EvmAddress.from_bytes(bytes(range(10)))
4753

54+
4855
def test_equality():
4956
"""Test equality and hash behavior."""
5057
raw = bytes(range(20))

0 commit comments

Comments
 (0)