Lines Matching refs:_strptime
12 import _strptime
17 self.assertEqual(_strptime._getlang(), locale.getlocale(locale.LC_TIME))
30 self.LT_ins = _strptime.LocaleTime()
98 LT = _strptime.LocaleTime()
106 self.assertEqual(self.LT_ins.lang, _strptime._getlang())
114 self.time_re = _strptime.TimeRE()
115 self.locale_time = _strptime.LocaleTime()
167 test_locale = _strptime.LocaleTime()
169 self.assertEqual(_strptime.TimeRE(test_locale).pattern("%Z"), '',
182 locale_time = _strptime.LocaleTime()
186 time_re = _strptime.TimeRE(locale_time)
209 self.assertRaises(ValueError, _strptime._strptime_time, data_string="%d",
213 _strptime._strptime_time("2005", bad_format)
224 self.assertRaises(ValueError, _strptime._strptime_time, "10 12", "%m")
229 strp_output = _strptime._strptime_time(strf_output, "%" + directive)
242 strp_output = _strptime._strptime_time(bound, '%y')
261 strp_output = _strptime._strptime_time(strf_output, "%I %p")
278 tup, frac = _strptime._strptime(str(d), format="%Y-%m-%d %H:%M:%S.%f")
295 strp_output = _strptime._strptime_time("UTC", "%Z")
297 strp_output = _strptime._strptime_time("GMT", "%Z")
301 strp_output = _strptime._strptime_time(strf_output, "%Z")
302 locale_time = _strptime.LocaleTime()
324 tz_value = _strptime._strptime_time(tz_name, "%Z")[8]
348 strp_output = _strptime._strptime_time(strf_output, "%m %% %Y")
356 self.assertTrue(_strptime._strptime_time(strf_output.upper(), "%B"),
358 self.assertTrue(_strptime._strptime_time(strf_output.lower(), "%B"),
360 self.assertTrue(_strptime._strptime_time(strf_output.capitalize(), "%B"),
366 strp_output = _strptime._strptime_time('1', '%m')
378 self.assertTrue(_strptime._strptime_time(need_escaping, need_escaping))
395 eq(_strptime._strptime_time('12 PM', '%I %p')[3], 12)
396 eq(_strptime._strptime_time('12 AM', '%I %p')[3], 0)
406 eq(_strptime._strptime_time('%d 2004' % i, '%j %Y')[7], i)
417 result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple),
426 result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple),
440 result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple),
454 strp_output = _strptime._strptime_time(strp_input, format_string)
488 self.assertEqual(_strptime._strptime_time(value, format)[:-1], expected)
525 _strptime._strptime_time("10", "%d")
526 _strptime._strptime_time("2005", "%Y")
527 _strptime._TimeRE_cache.locale_time.lang = "Ni"
528 original_time_re = _strptime._TimeRE_cache
529 _strptime._strptime_time("10", "%d")
530 self.assertIsNot(original_time_re, _strptime._TimeRE_cache)
531 self.assertEqual(len(_strptime._regex_cache), 1)
536 del _strptime._regex_cache['%d']
540 while len(_strptime._regex_cache) <= _strptime._CACHE_MAX_SIZE:
541 _strptime._regex_cache[bogus_key] = None
543 _strptime._strptime_time("10", "%d")
544 self.assertEqual(len(_strptime._regex_cache), 1)
549 locale_time_id = _strptime._TimeRE_cache.locale_time
550 _strptime._TimeRE_cache.locale_time.lang = "Ni"
551 _strptime._strptime_time("10", "%d")
552 self.assertIsNot(locale_time_id, _strptime._TimeRE_cache.locale_time)
562 _strptime._strptime_time('10', '%d')
564 first_time_re = _strptime._TimeRE_cache
568 _strptime._strptime_time('10', '%d')
570 second_time_re = _strptime._TimeRE_cache
587 tm = _strptime._strptime_time(time.tzname[0], '%Z')
589 tm = _strptime._strptime_time(time.tzname[1], '%Z')
592 first_time_re = _strptime._TimeRE_cache
596 tm = _strptime._strptime_time(time.tzname[0], '%Z')
598 tm = _strptime._strptime_time(time.tzname[1], '%Z')
601 second_time_re = _strptime._TimeRE_cache
606 _strptime._strptime_time(oldtzname[0], '%Z')
608 _strptime._strptime_time(oldtzname[1], '%Z')