File: test_humanize_hexstr.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 (26 lines) | stat: -rw-r--r-- 614 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import pytest

from eth_utils import (
    humanize_hexstr,
)


@pytest.mark.parametrize(
    "value,expected",
    (
        (
            "0x000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
            "0x0001..1e1f",
        ),
        (
            "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
            "0001..1e1f",
        ),
        ("0x3040506070", "0x3040..6070"),
        ("0x30405060", "0x30405060"),
        ("30060", "30060"),
        ("0x30060", "0x30060"),
    ),
)
def test_humanize_hexstr(value, expected):
    assert humanize_hexstr(value) == expected