MCPcopy Create free account
hub / github.com/dateutil/dateutil / testFuzzyWithTokens

Method testFuzzyWithTokens

tests/test_parser.py:509–521  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

507 tzinfo=self.brsttz))
508
509 def testFuzzyWithTokens(self):
510 s1 = "Today is 25 of September of 2003, exactly " \
511 "at 10:49:41 with timezone -03:00."
512 self.assertEqual(parse(s1, fuzzy_with_tokens=True),
513 (datetime(2003, 9, 25, 10, 49, 41,
514 tzinfo=self.brsttz),
515 ('Today is ', 'of ', ', exactly at ',
516 ' with timezone ', '.')))
517
518 s2 = "http://biz.yahoo.com/ipo/p/600221.html"
519 self.assertEqual(parse(s2, fuzzy_with_tokens=True),
520 (datetime(2060, 2, 21, 0, 0, 0),
521 ('http://biz.yahoo.com/ipo/p/', '.html')))
522
523 def testFuzzyAMPMProblem(self):
524 # Sometimes fuzzy parsing results in AM/PM flag being set without

Callers

nothing calls this directly

Calls 1

parseFunction · 0.90

Tested by

no test coverage detected