Example #1
0
 def test_Y(self):
     from _testcapi import getargs_Y
     obj = bytearray(b'bytearray')
     self.assertIs(getargs_Y(obj), obj)
     self.assertRaises(TypeError, getargs_Y, b'bytes')
     self.assertRaises(TypeError, getargs_Y, 'str')
     self.assertRaises(TypeError, getargs_Y, None)
     self.assertRaises(TypeError, getargs_Y, memoryview(obj))
Example #2
0
 def test_Y(self):
     from _testcapi import getargs_Y
     obj = bytearray('bytearray')
     self.assertIs(getargs_Y(obj), obj)
     self.assertRaises(TypeError, getargs_Y, 'str')
     if test_support.have_unicode:
         self.assertRaises(TypeError, getargs_Y, u'unicode')
     self.assertRaises(TypeError, getargs_Y, None)
     self.assertRaises(TypeError, getargs_Y, memoryview(obj))
     self.assertRaises(TypeError, getargs_Y, buffer(obj))