def test_z_star(self): from _testcapi import getargs_z_star self.assertEqual(getargs_z_star('abc\xe9'), 'abc\xe9') self.assertEqual(getargs_z_star(u'abc'), 'abc') self.assertEqual(getargs_z_star('nul:\0'), 'nul:\0') self.assertEqual(getargs_z_star(u'nul:\0'), 'nul:\0') self.assertEqual(getargs_z_star(bytearray('abc\xe9')), 'abc\xe9') self.assertEqual(getargs_z_star(memoryview('abc\xe9')), 'abc\xe9') with test_support.check_py3k_warnings(): self.assertEqual(getargs_z_star(buffer('abc\xe9')), 'abc\xe9') self.assertEqual(getargs_z_star(buffer(u'abc\xe9')), str(buffer(u'abc\xe9'))) self.assertIsNone(getargs_z_star(None))
def test_z_star(self): from _testcapi import getargs_z_star self.assertEqual(getargs_z_star('abc\xe9'), b'abc\xc3\xa9') self.assertEqual(getargs_z_star('nul:\0'), b'nul:\0') self.assertEqual(getargs_z_star(b'bytes'), b'bytes') self.assertEqual(getargs_z_star(bytearray(b'bytearray')), b'bytearray') self.assertEqual(getargs_z_star(memoryview(b'memoryview')), b'memoryview') self.assertIsNone(getargs_z_star(None))
def test_z_star(self): from _testcapi import getargs_z_star self.assertEqual(getargs_z_star("abc\xe9"), b"abc\xc3\xa9") self.assertEqual(getargs_z_star("nul:\0"), b"nul:\0") self.assertEqual(getargs_z_star(b"bytes"), b"bytes") self.assertEqual(getargs_z_star(bytearray(b"bytearray")), b"bytearray") self.assertEqual(getargs_z_star(memoryview(b"memoryview")), b"memoryview") self.assertIsNone(getargs_z_star(None))