Skip to content

Commit e3bd4bd

Browse files
committed
100% COVERAGE!!111
1 parent 8040eca commit e3bd4bd

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

multiaddr/codecs/fspath.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
import sys
1818

1919
def fsencode(path):
20-
if not isinstance(path, six.binary_type):
20+
if not isinstance(path, six.binary_type): # pragma: no cover
2121
path = path.encode(sys.getfilesystemencoding())
2222
return path
2323

2424
def fsdecode(path):
25-
if not isinstance(path, six.text_type):
25+
if not isinstance(path, six.text_type): # pragma: no cover
2626
path = path.decode(sys.getfilesystemencoding())
2727
return path
2828

tests/test_protocols.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ def test_protocol_with_name():
7777
proto = protocols.protocol_with_name('ip4')
7878
assert proto.name == 'ip4'
7979
assert proto.code == protocols.P_IP4
80+
assert proto.size == 32
81+
assert proto.vcode == varint.encode(protocols.P_IP4)
8082

8183
with pytest.raises(exceptions.ProtocolNotFoundError):
8284
proto = protocols.protocol_with_name('foo')
@@ -86,6 +88,8 @@ def test_protocol_with_code():
8688
proto = protocols.protocol_with_code(protocols.P_IP4)
8789
assert proto.name == 'ip4'
8890
assert proto.code == protocols.P_IP4
91+
assert proto.size == 32
92+
assert proto.vcode == varint.encode(protocols.P_IP4)
8993

9094
with pytest.raises(exceptions.ProtocolNotFoundError):
9195
proto = protocols.protocol_with_code(1234)

0 commit comments

Comments
 (0)