Lines Matching refs:_strptime
13 import _strptime
18 self.assertEqual(_strptime._getlang(), locale.getlocale(locale.LC_TIME))
31 self.LT_ins = _strptime.LocaleTime()
99 LT = _strptime.LocaleTime()
107 self.assertEqual(self.LT_ins.lang, _strptime._getlang())
115 self.time_re = _strptime.TimeRE()
116 self.locale_time = _strptime.LocaleTime()
169 test_locale = _strptime.LocaleTime()
171 self.assertEqual(_strptime.TimeRE(test_locale).pattern("%Z"), '',
184 locale_time = _strptime.LocaleTime()
188 time_re = _strptime.TimeRE(locale_time)
211 self.assertRaises(ValueError, _strptime._strptime_time, data_string="%d",
215 _strptime._strptime_time("2005", bad_format)
228 _strptime._strptime("1999 50", "%Y %V")
231 _strptime._strptime("1999 51", "%G %V")
235 _strptime._strptime("1999 51","%G %{}".format(w))
238 _strptime._strptime("2015", "%G")
241 _strptime._strptime("1999 256", "%G %j")
247 _strptime._strptime_time('', '%D')
251 _strptime._strptime_time('19', '%Y %')
256 self.assertRaises(ValueError, _strptime._strptime_time, "10 12", "%m")
261 strp_output = _strptime._strptime_time(strf_output, "%" + directive)
274 strp_output = _strptime._strptime_time(bound, '%y')
293 strp_output = _strptime._strptime_time(strf_output, "%I %p")
310 tup, frac, _ = _strptime._strptime(str(d), format="%Y-%m-%d %H:%M:%S.%f")
326 (*_, offset), _, offset_fraction = _strptime._strptime("+0130", "%z")
329 (*_, offset), _, offset_fraction = _strptime._strptime("-0100", "%z")
332 (*_, offset), _, offset_fraction = _strptime._strptime("-013030", "%z")
335 (*_, offset), _, offset_fraction = _strptime._strptime("-013030.000001", "%z")
338 (*_, offset), _, offset_fraction = _strptime._strptime("+01:00", "%z")
341 (*_, offset), _, offset_fraction = _strptime._strptime("-01:30", "%z")
344 (*_, offset), _, offset_fraction = _strptime._strptime("-01:30:30", "%z")
347 (*_, offset), _, offset_fraction = _strptime._strptime("-01:30:30.000001", "%z")
350 (*_, offset), _, offset_fraction = _strptime._strptime("+01:30:30.001", "%z")
353 (*_, offset), _, offset_fraction = _strptime._strptime("Z", "%z")
359 _strptime._strptime("-01:30:30.", "%z")
361 _strptime._strptime("-0130:30", "%z")
363 _strptime._strptime("-01:30:30.1234567", "%z")
365 _strptime._strptime("-01:30:30:123456", "%z")
367 _strptime._strptime("-01:3030", "%z")
376 strp_output = _strptime._strptime_time("UTC", "%Z")
378 strp_output = _strptime._strptime_time("GMT", "%Z")
382 strp_output = _strptime._strptime_time(strf_output, "%Z")
383 locale_time = _strptime.LocaleTime()
405 tz_value = _strptime._strptime_time(tz_name, "%Z")[8]
429 strp_output = _strptime._strptime_time(strf_output, "%m %% %Y")
437 self.assertTrue(_strptime._strptime_time(strf_output.upper(), "%B"),
439 self.assertTrue(_strptime._strptime_time(strf_output.lower(), "%B"),
441 self.assertTrue(_strptime._strptime_time(strf_output.capitalize(), "%B"),
447 strp_output = _strptime._strptime_time('1', '%m')
459 self.assertTrue(_strptime._strptime_time(need_escaping, need_escaping))
476 eq(_strptime._strptime_time('12 PM', '%I %p')[3], 12)
477 eq(_strptime._strptime_time('12 AM', '%I %p')[3], 0)
487 eq(_strptime._strptime_time('%d 2004' % i, '%j %Y')[7], i)
499 result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple),
509 result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple),
524 result = _strptime._strptime_time(time.strftime(format_string, self.time_tuple),
557 strp_output = _strptime._strptime_time(strp_input,
591 self.assertEqual(_strptime._strptime_time(value, format)[:-1], expected)
643 _strptime._strptime_time("10", "%d")
644 _strptime._strptime_time("2005", "%Y")
645 _strptime._TimeRE_cache.locale_time.lang = "Ni"
646 original_time_re = _strptime._TimeRE_cache
647 _strptime._strptime_time("10", "%d")
648 self.assertIsNot(original_time_re, _strptime._TimeRE_cache)
649 self.assertEqual(len(_strptime._regex_cache), 1)
654 del _strptime._regex_cache['%d']
658 while len(_strptime._regex_cache) <= _strptime._CACHE_MAX_SIZE:
659 _strptime._regex_cache[bogus_key] = None
661 _strptime._strptime_time("10", "%d")
662 self.assertEqual(len(_strptime._regex_cache), 1)
667 locale_time_id = _strptime._TimeRE_cache.locale_time
668 _strptime._TimeRE_cache.locale_time.lang = "Ni"
669 _strptime._strptime_time("10", "%d")
670 self.assertIsNot(locale_time_id, _strptime._TimeRE_cache.locale_time)
680 _strptime._strptime_time('10', '%d')
682 first_time_re = _strptime._TimeRE_cache
686 _strptime._strptime_time('10', '%d')
688 second_time_re = _strptime._TimeRE_cache
705 tm = _strptime._strptime_time(time.tzname[0], '%Z')
707 tm = _strptime._strptime_time(time.tzname[1], '%Z')
710 first_time_re = _strptime._TimeRE_cache
714 tm = _strptime._strptime_time(time.tzname[0], '%Z')
716 tm = _strptime._strptime_time(time.tzname[1], '%Z')
719 second_time_re = _strptime._TimeRE_cache
724 _strptime._strptime_time(oldtzname[0], '%Z')
726 _strptime._strptime_time(oldtzname[1], '%Z')