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)
226 _strptime._strptime("1999 50", "%Y %V")
229 _strptime._strptime("1999 51", "%G %V")
233 _strptime._strptime("1999 51","%G %{}".format(w))
236 _strptime._strptime("2015", "%G")
239 _strptime._strptime("1999 256", "%G %j")
245 _strptime._strptime_time('', '%D')
249 _strptime._strptime_time('19', '%Y %')
254 self.assertRaises(ValueError, _strptime._strptime_time, "10 12", "%m")
259 strp_output = _strptime._strptime_time(strf_output, "%" + directive)
272 strp_output = _strptime._strptime_time(bound, '%y')
291 strp_output = _strptime._strptime_time(strf_output, "%I %p")
308 tup, frac, _ = _strptime._strptime(str(d), format="%Y-%m-%d %H:%M:%S.%f")
324 (*_, offset), _, offset_fraction = _strptime._strptime("+0130", "%z")
327 (*_, offset), _, offset_fraction = _strptime._strptime("-0100", "%z")
330 (*_, offset), _, offset_fraction = _strptime._strptime("-013030", "%z")
333 (*_, offset), _, offset_fraction = _strptime._strptime("-013030.000001", "%z")
336 (*_, offset), _, offset_fraction = _strptime._strptime("+01:00", "%z")
339 (*_, offset), _, offset_fraction = _strptime._strptime("-01:30", "%z")
342 (*_, offset), _, offset_fraction = _strptime._strptime("-01:30:30", "%z")
345 (*_, offset), _, offset_fraction = _strptime._strptime("-01:30:30.000001", "%z")
348 (*_, offset), _, offset_fraction = _strptime._strptime("+01:30:30.001", "%z")
351 (*_, offset), _, offset_fraction = _strptime._strptime("Z", "%z")
357 _strptime._strptime("-01:30:30.", "%z")
359 _strptime._strptime("-0130:30", "%z")
361 _strptime._strptime("-01:30:30.1234567", "%z")
363 _strptime._strptime("-01:30:30:123456", "%z")
365 _strptime._strptime("-01:3030", "%z")
373 strp_output = _strptime._strptime_time("UTC", "%Z")
375 strp_output = _strptime._strptime_time("GMT", "%Z")
379 strp_output = _strptime._strptime_time(strf_output, "%Z")
380 locale_time = _strptime.LocaleTime()
402 tz_value = _strptime._strptime_time(tz_name, "%Z")[8]
426 strp_output = _strptime._strptime_time(strf_output, "%m %% %Y")
434 self.assertTrue(_strptime._strptime_time(strf_output.upper(), "%B"),
436 self.assertTrue(_strptime._strptime_time(strf_output.lower(), "%B"),
438 self.assertTrue(_strptime._strptime_time(strf_output.capitalize(), "%B"),
444 strp_output = _strptime._strptime_time('1', '%m')
456 self.assertTrue(_strptime._strptime_time(need_escaping, need_escaping))
473 eq(_strptime._strptime_time('12 PM', '%I %p')[3], 12)
474 eq(_strptime._strptime_time('12 AM', '%I %p')[3], 0)
484 eq(_strptime._strptime_time('%d 2004' % i, '%j %Y')[7], i)
495 result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple),
504 result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple),
518 result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple),
551 strp_output = _strptime._strptime_time(strp_input,
585 self.assertEqual(_strptime._strptime_time(value, format)[:-1], expected)
637 _strptime._strptime_time("10", "%d")
638 _strptime._strptime_time("2005", "%Y")
639 _strptime._TimeRE_cache.locale_time.lang = "Ni"
640 original_time_re = _strptime._TimeRE_cache
641 _strptime._strptime_time("10", "%d")
642 self.assertIsNot(original_time_re, _strptime._TimeRE_cache)
643 self.assertEqual(len(_strptime._regex_cache), 1)
648 del _strptime._regex_cache['%d']
652 while len(_strptime._regex_cache) <= _strptime._CACHE_MAX_SIZE:
653 _strptime._regex_cache[bogus_key] = None
655 _strptime._strptime_time("10", "%d")
656 self.assertEqual(len(_strptime._regex_cache), 1)
661 locale_time_id = _strptime._TimeRE_cache.locale_time
662 _strptime._TimeRE_cache.locale_time.lang = "Ni"
663 _strptime._strptime_time("10", "%d")
664 self.assertIsNot(locale_time_id, _strptime._TimeRE_cache.locale_time)
674 _strptime._strptime_time('10', '%d')
676 first_time_re = _strptime._TimeRE_cache
680 _strptime._strptime_time('10', '%d')
682 second_time_re = _strptime._TimeRE_cache
699 tm = _strptime._strptime_time(time.tzname[0], '%Z')
701 tm = _strptime._strptime_time(time.tzname[1], '%Z')
704 first_time_re = _strptime._TimeRE_cache
708 tm = _strptime._strptime_time(time.tzname[0], '%Z')
710 tm = _strptime._strptime_time(time.tzname[1], '%Z')
713 second_time_re = _strptime._TimeRE_cache
718 _strptime._strptime_time(oldtzname[0], '%Z')
720 _strptime._strptime_time(oldtzname[1], '%Z')