MCPcopy Index your code
hub / github.com/python/cpython / test_param_default_bytes_literal

Method test_param_default_bytes_literal

Lib/test/test_clinic.py:1160–1176  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1158 r'{.buf = " \t\n\r\v\f\302\240", .obj = NULL, .len = 8}')
1159
1160 def test_param_default_bytes_literal(self):
1161 function = self.parse_function(r"""
1162 module test
1163 test.func
1164 str: str(accept={robuffer}) = b' \t\n\r\v\f\xa0'
1165 buf: Py_buffer = b' \t\n\r\v\f\xa0'
1166 """)
1167 p = function.parameters['str']
1168 self.assertEqual(p.default, b' \t\n\r\v\f\xa0')
1169 self.assertEqual(p.converter.py_default, r"b' \t\n\r\x0b\x0c\xa0'")
1170 self.assertEqual(p.converter.c_default, r'" \t\n\r\v\f\240"')
1171
1172 p = function.parameters['buf']
1173 self.assertEqual(p.default, b' \t\n\r\v\f\xa0')
1174 self.assertEqual(p.converter.py_default, r"b' \t\n\r\x0b\x0c\xa0'")
1175 self.assertEqual(p.converter.c_default,
1176 r'{.buf = " \t\n\r\v\f\240", .obj = NULL, .len = 7}')
1177
1178 def test_param_default_byte_literal(self):
1179 function = self.parse_function(r"""

Callers

nothing calls this directly

Calls 2

parse_functionMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected