예제 #1
0
파일: test_compat.py 프로젝트: hhco/txdarn
 def test_stringFromNetworkFails_py3(self):
     with self.assertRaises(TypeError):
         C.stringFromNetwork("i fail because i'm a native string")
예제 #2
0
파일: test_compat.py 프로젝트: hhco/txdarn
    def test_stringFromNetworkFails_py2(self):
        with self.assertRaises(TypeError):
            C.stringFromNetwork(u"i fail because i'm unicode")

        with self.assertRaises(UnicodeDecodeError):
            C.stringFromNetwork("\xff fails because it's not ascii")
예제 #3
0
파일: test_compat.py 프로젝트: hhco/txdarn
 def test_stringFromNetwork(self):
     self.assertEqual(C.stringFromNetwork(b'bytes to native string'),
                      'bytes to native string')