예제 #1
0
파일: test_compat.py 프로젝트: hhco/txdarn
 def test_networkStringFails_py3(self):
     with self.assertRaises(TypeError):
         C.networkString(b"i fail because i'm bytes")
예제 #2
0
파일: test_compat.py 프로젝트: hhco/txdarn
    def test_networkStringFails_py2(self):
        with self.assertRaises(TypeError):
            C.networkString(u"i fail because i'm unicode")

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