parse_date: insist that it returns an int

This commit is contained in:
Brian Warner 2009-03-19 11:44:43 -07:00
parent 186b6a8c01
commit 66fe8ca24c
2 changed files with 2 additions and 1 deletions

View File

@ -2166,6 +2166,7 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin):
def test_parse_date(self):
p = time_format.parse_date
self.failUnless(isinstance(p("2009-03-18"), int))
self.failUnlessEqual(p("2009-03-18"), 1237334400)
def test_limited_history(self):

View File

@ -62,5 +62,5 @@ def parse_duration(s):
def parse_date(s):
# return seconds-since-epoch for the UTC midnight that starts the given
# day
return iso_utc_time_to_localseconds(s + "T00:00:00")
return int(iso_utc_time_to_localseconds(s + "T00:00:00"))