mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 05:28:04 +00:00
parse_date: insist that it returns an int
This commit is contained in:
parent
186b6a8c01
commit
66fe8ca24c
@ -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):
|
||||
|
@ -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"))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user