mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-22 08:50:07 +00:00
parse_date: insist that it returns an int
This commit is contained in:
@ -2166,6 +2166,7 @@ class LeaseCrawler(unittest.TestCase, pollmixin.PollMixin, WebRenderingMixin):
|
|||||||
|
|
||||||
def test_parse_date(self):
|
def test_parse_date(self):
|
||||||
p = time_format.parse_date
|
p = time_format.parse_date
|
||||||
|
self.failUnless(isinstance(p("2009-03-18"), int))
|
||||||
self.failUnlessEqual(p("2009-03-18"), 1237334400)
|
self.failUnlessEqual(p("2009-03-18"), 1237334400)
|
||||||
|
|
||||||
def test_limited_history(self):
|
def test_limited_history(self):
|
||||||
|
@ -62,5 +62,5 @@ def parse_duration(s):
|
|||||||
def parse_date(s):
|
def parse_date(s):
|
||||||
# return seconds-since-epoch for the UTC midnight that starts the given
|
# return seconds-since-epoch for the UTC midnight that starts the given
|
||||||
# day
|
# day
|
||||||
return iso_utc_time_to_localseconds(s + "T00:00:00")
|
return int(iso_utc_time_to_localseconds(s + "T00:00:00"))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user