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

Method test_param_default_str_literal

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

Source from the content-addressed store, hash-verified

1140 self.assertEqual(p.converter.c_default, 'NULL')
1141
1142 def test_param_default_str_literal(self):
1143 function = self.parse_function(r"""
1144 module test
1145 test.func
1146 str: str = ' \t\n\r\v\f\xa0'
1147 buf: Py_buffer(accept={str, buffer}) = ' \t\n\r\v\f\xa0'
1148 """)
1149 p = function.parameters['str']
1150 self.assertEqual(p.default, ' \t\n\r\v\f\xa0')
1151 self.assertEqual(p.converter.py_default, r"' \t\n\r\x0b\x0c\xa0'")
1152 self.assertEqual(p.converter.c_default, r'" \t\n\r\v\f\u00a0"')
1153
1154 p = function.parameters['buf']
1155 self.assertEqual(p.default, ' \t\n\r\v\f\xa0')
1156 self.assertEqual(p.converter.py_default, r"' \t\n\r\x0b\x0c\xa0'")
1157 self.assertEqual(p.converter.c_default,
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"""

Callers

nothing calls this directly

Calls 2

parse_functionMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected