Skip to content

Commit e7e9f06

Browse files
committed
Add test for ip6zone codec's invalid case
1 parent e243375 commit e7e9f06

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_transforms.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
# These test values were generated by running them
2222
# through the go implementation of multiaddr.
23-
# https://github.com/jbenet/multiaddr
23+
# https://github.com/multiformats/go-multiaddr
2424
ADDR_BYTES_MAP_STR_TEST_DATA = [
2525
(_names_to_protocols['ip4'], b'\x0a\x0b\x0c\x0d', '10.11.12.13'),
2626
(_names_to_protocols['ip6'],
@@ -148,6 +148,7 @@ def test_bytes_to_string_value_error(protocol_extension, bytes):
148148
(_names_to_protocols['onion'], 'timaq4ygg2iegci7:0'),
149149
(_names_to_protocols['onion'], 'timaq4ygg2iegci7:71234'),
150150
(_names_to_protocols['p2p'], '15230d52ebb89d85b02a284948203a'),
151+
(_names_to_protocols['ip6zone'], ""),
151152
])
152153
def test_codec_to_bytes_value_error(proto, address):
153154
# Codecs themselves may raise any exception type – it will then be converted
@@ -157,7 +158,8 @@ def test_codec_to_bytes_value_error(proto, address):
157158

158159

159160
@pytest.mark.parametrize("proto, buf", [
160-
(_names_to_protocols['tcp'], b'\xff\xff\xff\xff')
161+
(_names_to_protocols['tcp'], b'\xff\xff\xff\xff'),
162+
(_names_to_protocols['ip6zone'], b""),
161163
])
162164
def test_codec_to_string_value_error(proto, buf):
163165
# Codecs themselves may raise any exception type – it will then be converted

0 commit comments

Comments
 (0)