def test_C(self): from _testcapi import getargs_C self.assertRaises(TypeError, getargs_C, 'abc') # len > 1 self.assertEqual(getargs_C('a'), 97) self.assertEqual(getargs_C('\u20ac'), 0x20ac) self.assertEqual(getargs_C('\U0001f40d'), 0x1f40d) self.assertRaises(TypeError, getargs_C, b'a') self.assertRaises(TypeError, getargs_C, bytearray(b'a')) self.assertRaises(TypeError, getargs_C, memoryview(b'a')) self.assertRaises(TypeError, getargs_C, 97) self.assertRaises(TypeError, getargs_C, None)
def test_C(self): from _testcapi import getargs_C self.assertRaises(TypeError, getargs_C, 'abc') self.assertEqual(getargs_C('a'), 97) self.assertEqual(getargs_C('€'), 8364) self.assertEqual(getargs_C('🐍'), 128013) self.assertRaises(TypeError, getargs_C, b'a') self.assertRaises(TypeError, getargs_C, bytearray(b'a')) self.assertRaises(TypeError, getargs_C, memoryview(b'a')) self.assertRaises(TypeError, getargs_C, 97) self.assertRaises(TypeError, getargs_C, None)
def test_C(self): from _testcapi import getargs_C self.assertRaises(TypeError, getargs_C, 'abc') # len > 1 self.assertEqual(getargs_C('a'), 97) self.assertEqual(getargs_C('\u20ac'), 0x20ac) self.assertEqual(getargs_C('\U0001f40d'), 0x1f40d) self.assertRaises(TypeError, getargs_C, b'a') self.assertRaises(TypeError, getargs_C, bytearray(b'a')) self.assertRaises(TypeError, getargs_C, memoryview(b'a')) self.assertRaises(TypeError, getargs_C, 97) self.assertRaises(TypeError, getargs_C, None)
def test_C(self): from _testcapi import getargs_C self.assertRaises(TypeError, getargs_C, "abc") # len > 1 self.assertEqual(getargs_C("a"), 97) self.assertEqual(getargs_C("\u20ac"), 0x20AC) self.assertEqual(getargs_C("\U0001f40d"), 0x1F40D) self.assertRaises(TypeError, getargs_C, b"a") self.assertRaises(TypeError, getargs_C, bytearray(b"a")) self.assertRaises(TypeError, getargs_C, memoryview(b"a")) self.assertRaises(TypeError, getargs_C, 97) self.assertRaises(TypeError, getargs_C, None)