Exemple #1
0
 def test_stringFromNetworkFails_py3(self):
     with self.assertRaises(TypeError):
         C.stringFromNetwork("i fail because i'm a native string")
Exemple #2
0
    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")
Exemple #3
0
 def test_stringFromNetwork(self):
     self.assertEqual(C.stringFromNetwork(b'bytes to native string'),
                      'bytes to native string')