diff --git a/test_iconv.py b/test_iconv.py index c6b9de1..87f6224 100644 --- a/test_iconv.py +++ b/test_iconv.py @@ -12,3 +12,10 @@ def test_with_length(self): s = iconv.open("utf-16le", "utf-8") r = s.iconv(b"Hallo", 11) self.assertEqual(r, "Hallo".encode("utf-16le")) + + def test_incorrect_input_type(self): + s = iconv.open("latin1", "utf-8") + with self.assertRaisesRegex( + TypeError, "iconv expects byte object as first argument" + ): + r = s.iconv("Hallo")