Example #1
0
 def test_U(self):
     from _testcapi import getargs_U
     obj = 'str'
     self.assertIs(getargs_U(obj), obj)
     self.assertRaises(TypeError, getargs_U, b'bytes')
     self.assertRaises(TypeError, getargs_U, bytearray(b'bytearray'))
     self.assertRaises(TypeError, getargs_U, None)
Example #2
0
 def test_U(self):
     from _testcapi import getargs_U
     obj = 'str'
     self.assertIs(getargs_U(obj), obj)
     self.assertRaises(TypeError, getargs_U, b'bytes')
     self.assertRaises(TypeError, getargs_U, bytearray(b'bytearray'))
     self.assertRaises(TypeError, getargs_U, None)
Example #3
0
 def test_U(self):
     from _testcapi import getargs_U
     obj = u'unicode'
     self.assertIs(getargs_U(obj), obj)
     self.assertRaises(TypeError, getargs_U, 'str')
     self.assertRaises(TypeError, getargs_U, bytearray('bytearray'))
     self.assertRaises(TypeError, getargs_U, None)
     self.assertRaises(TypeError, getargs_U, memoryview(obj))
     self.assertRaises(TypeError, getargs_U, buffer(obj))
Example #4
0
 def test_U(self):
     from _testcapi import getargs_U
     obj = u'unicode'
     self.assertIs(getargs_U(obj), obj)
     self.assertRaises(TypeError, getargs_U, 'str')
     self.assertRaises(TypeError, getargs_U, bytearray('bytearray'))
     self.assertRaises(TypeError, getargs_U, None)
     self.assertRaises(TypeError, getargs_U, memoryview(obj))
     self.assertRaises(TypeError, getargs_U, buffer(obj))