File: test_humanize_bytes.py

package info (click to toggle)
python-eth-utils 5.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,140 kB
  • sloc: python: 5,985; makefile: 238
file content (18 lines) | stat: -rw-r--r-- 374 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import pytest

from eth_utils import (
    humanize_bytes,
)


@pytest.mark.parametrize(
    "value,expected",
    (
        (bytes(range(32)), "0001..1e1f"),
        (bytes(range(3)), "000102"),
        (bytes(range(5)), "0001020304"),
        (bytes(range(6)), "0001..0405"),
    ),
)
def test_humanize_bytes(value, expected):
    assert humanize_bytes(value) == expected