diff --git a/tests/test_merkle_set.py b/tests/test_merkle_set.py index 595abd98..3f42d58c 100644 --- a/tests/test_merkle_set.py +++ b/tests/test_merkle_set.py @@ -66,7 +66,7 @@ def check_tree(leafs: List[bytes32]) -> None: ) for i in range(256): - item = bytes32.fill(i.to_bytes(), fill=b"\x02", align="<") + item = bytes32.fill(bytes([i]), fill=b"\x02", align="<") py_included, py_proof = py_tree.is_included_already_hashed(item) assert not py_included ru_included, ru_proof = ru_tree.is_included_already_hashed(item) diff --git a/tests/test_sized_bytes.py b/tests/test_sized_bytes.py index a7b8aef1..ec357600 100644 --- a/tests/test_sized_bytes.py +++ b/tests/test_sized_bytes.py @@ -29,8 +29,12 @@ def test_fill_not_multiple_raises() -> None: with pytest.raises(ValueError): bytes8.fill(b"\x00", fill=b"\x01\x01") + def test_align_left() -> None: - assert bytes8.fill(b"\x01", fill=b"\x02", align="<") == bytes8([1, 2, 2, 2, 2, 2, 2, 2]) + assert bytes8.fill(b"\x01", fill=b"\x02", align="<") == bytes8( + [1, 2, 2, 2, 2, 2, 2, 2] + ) + def test_invalid_alignment() -> None: with pytest.raises(ValueError):