File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 17
17
import sys
18
18
19
19
def fsencode (path ):
20
- if not isinstance (path , six .binary_type ):
20
+ if not isinstance (path , six .binary_type ): # pragma: no cover
21
21
path = path .encode (sys .getfilesystemencoding ())
22
22
return path
23
23
24
24
def fsdecode (path ):
25
- if not isinstance (path , six .text_type ):
25
+ if not isinstance (path , six .text_type ): # pragma: no cover
26
26
path = path .decode (sys .getfilesystemencoding ())
27
27
return path
28
28
Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ def test_protocol_with_name():
77
77
proto = protocols .protocol_with_name ('ip4' )
78
78
assert proto .name == 'ip4'
79
79
assert proto .code == protocols .P_IP4
80
+ assert proto .size == 32
81
+ assert proto .vcode == varint .encode (protocols .P_IP4 )
80
82
81
83
with pytest .raises (exceptions .ProtocolNotFoundError ):
82
84
proto = protocols .protocol_with_name ('foo' )
@@ -86,6 +88,8 @@ def test_protocol_with_code():
86
88
proto = protocols .protocol_with_code (protocols .P_IP4 )
87
89
assert proto .name == 'ip4'
88
90
assert proto .code == protocols .P_IP4
91
+ assert proto .size == 32
92
+ assert proto .vcode == varint .encode (protocols .P_IP4 )
89
93
90
94
with pytest .raises (exceptions .ProtocolNotFoundError ):
91
95
proto = protocols .protocol_with_code (1234 )
You can’t perform that action at this time.
0 commit comments