File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,14 @@ def test_write_int_string(self):
16
16
'\x00 \x00 \x00 \x0b some string'
17
17
)
18
18
19
+ def test_write_int_string__unicode (self ):
20
+ with self .assertRaises (TypeError ) as cm :
21
+ kafka .util .write_int_string (u'unicode' )
22
+ #: :type: TypeError
23
+ te = cm .exception
24
+ self .assertIn ('unicode' , te .message )
25
+ self .assertIn ('to be str' , te .message )
26
+
19
27
def test_write_int_string__empty (self ):
20
28
self .assertEqual (
21
29
kafka .util .write_int_string ('' ),
@@ -43,6 +51,14 @@ def test_write_short_string(self):
43
51
'\x00 \x0b some string'
44
52
)
45
53
54
+ def test_write_short_string__unicode (self ):
55
+ with self .assertRaises (TypeError ) as cm :
56
+ kafka .util .write_short_string (u'hello' )
57
+ #: :type: TypeError
58
+ te = cm .exception
59
+ self .assertIn ('unicode' , te .message )
60
+ self .assertIn ('to be str' , te .message )
61
+
46
62
def test_write_short_string__empty (self ):
47
63
self .assertEqual (
48
64
kafka .util .write_short_string ('' ),
You can’t perform that action at this time.
0 commit comments