Skip to content

Commit 9bbacda

Browse files
Add test for incorrect input type to iconv (#23)
1 parent 3c4a208 commit 9bbacda

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test_iconv.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ def test_with_length(self):
1212
s = iconv.open("utf-16le", "utf-8")
1313
r = s.iconv(b"Hallo", 11)
1414
self.assertEqual(r, "Hallo".encode("utf-16le"))
15+
16+
def test_incorrect_input_type(self):
17+
s = iconv.open("latin1", "utf-8")
18+
with self.assertRaisesRegex(
19+
TypeError, "iconv expects byte object as first argument"
20+
):
21+
r = s.iconv("Hallo")

0 commit comments

Comments
 (0)