11import unittest
22import iconvcodec
33import codecs
4+ import sys
45
56
67class TestIconvcodecModule (unittest .TestCase ):
8+ @unittest .skipUnless (sys .platform .startswith ("linux" ), "Linux only test" )
79 def test_encode (self ):
810 bytestring = "Hallo" .encode ("T.61" )
911 self .assertEqual (bytestring , b"Hallo" )
1012
1113 def test_encode_with_long_out (self ):
1214 """Edge case where output has more bytes than input as utf-8"""
1315 bytestring = "™" .encode ("ASCII//TRANSLIT" )
14- self .assertEqual (bytestring , b"(TM)" )
16+ if sys .platform .startswith ("linux" ):
17+ self .assertEqual (bytestring , b"(TM)" )
18+ else :
19+ self .assertEqual (bytestring , b"TM" )
1520
21+ @unittest .skipUnless (sys .platform .startswith ("linux" ), "Linux only test" )
1622 def test_decode (self ):
1723 string = b"Hallo" .decode ("T.61" )
1824 self .assertEqual (string , "Hallo" )
1925
26+ @unittest .skipUnless (sys .platform .startswith ("linux" ), "Linux only test" )
2027 def test_transliterate (self ):
2128 string = "abc ß α € àḃç"
2229 bytestring = string .encode ("ASCII//TRANSLIT" )
@@ -30,6 +37,7 @@ def test_incremental_encode(self):
3037 self .assertEqual (first , b"Foo" )
3138 self .assertEqual (second , b"bar" )
3239
40+ @unittest .skipUnless (sys .platform .startswith ("linux" ), "Linux only test" )
3341 def test_incremental_decode (self ):
3442 decoder = codecs .getincrementaldecoder ("UCS2" )()
3543 first = decoder .decode (b"\x41 " )
0 commit comments