예제 #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)
예제 #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)
예제 #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))
예제 #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))