def test_c(self): from _testcapi import getargs_c self.assertRaises(TypeError, getargs_c, b'abc') # len > 1 self.assertEqual(getargs_c(b'a'), b'a') self.assertEqual(getargs_c(bytearray(b'a')), b'a') self.assertRaises(TypeError, getargs_c, memoryview(b'a')) self.assertRaises(TypeError, getargs_c, 's') self.assertRaises(TypeError, getargs_c, None)
def test_c(self): from _testcapi import getargs_c self.assertRaises(TypeError, getargs_c, b"abc") # len > 1 self.assertEqual(getargs_c(b"a"), 97) self.assertEqual(getargs_c(bytearray(b"a")), 97) self.assertRaises(TypeError, getargs_c, memoryview(b"a")) self.assertRaises(TypeError, getargs_c, "s") 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) if test_support.have_unicode: self.assertRaises(TypeError, getargs_c, u's') self.assertRaises(TypeError, getargs_c, bytearray('a')) self.assertRaises(TypeError, getargs_c, memoryview('a')) with test_support.check_py3k_warnings(): self.assertRaises(TypeError, getargs_c, buffer('a')) self.assertRaises(TypeError, getargs_c, 97) self.assertRaises(TypeError, getargs_c, None)