Ejemplo n.º 1
0
 def test_y(self):
     from _testcapi import getargs_y
     self.assertRaises(TypeError, getargs_y, 'abc\xe9')
     self.assertEqual(getargs_y(b'bytes'), b'bytes')
     self.assertRaises(TypeError, getargs_y, b'nul:\0')
     self.assertRaises(TypeError, getargs_y, bytearray(b'bytearray'))
     self.assertRaises(TypeError, getargs_y, memoryview(b'memoryview'))
     self.assertRaises(TypeError, getargs_y, None)
Ejemplo n.º 2
0
 def test_y(self):
     from _testcapi import getargs_y
     self.assertRaises(TypeError, getargs_y, 'abc\xe9')
     self.assertEqual(getargs_y(b'bytes'), b'bytes')
     self.assertRaises(ValueError, getargs_y, b'nul:\0')
     self.assertRaises(TypeError, getargs_y, bytearray(b'bytearray'))
     self.assertRaises(TypeError, getargs_y, memoryview(b'memoryview'))
     self.assertRaises(TypeError, getargs_y, None)
Ejemplo n.º 3
0
    def test_y(self):
        from _testcapi import getargs_y

        self.assertRaises(TypeError, getargs_y, "abc\xe9")
        self.assertEqual(getargs_y(b"bytes"), b"bytes")
        self.assertRaises(ValueError, getargs_y, b"nul:\0")
        self.assertRaises(TypeError, getargs_y, bytearray(b"bytearray"))
        self.assertRaises(TypeError, getargs_y, memoryview(b"memoryview"))
        self.assertRaises(TypeError, getargs_y, None)