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

Method test_strptime

Lib/test/datetimetester.py:4191–4202  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4189 self.assertEqual(derived, expected)
4190
4191 def test_strptime(self):
4192 # bpo-34482: Check that surrogates are handled properly.
4193 inputs = [
4194 (self.theclass(13, 2, 47, 197000), '13:02:47.197', '%H:%M:%S.%f'),
4195 (self.theclass(13, 2, 47, 197000), '13:02\ud80047.197', '%H:%M\ud800%S.%f'),
4196 (self.theclass(13, 2, 47, 197000), '13\ud80002:47.197', '%H\ud800%M:%S.%f'),
4197 ]
4198 for expected, string, format in inputs:
4199 with self.subTest(string=string, format=format):
4200 got = self.theclass.strptime(string, format)
4201 self.assertEqual(expected, got)
4202 self.assertIs(type(got), self.theclass)
4203
4204 def test_strptime_tz(self):
4205 strptime = self.theclass.strptime

Callers

nothing calls this directly

Calls 4

subTestMethod · 0.45
strptimeMethod · 0.45
assertEqualMethod · 0.45
assertIsMethod · 0.45

Tested by

no test coverage detected