From: Brian Warner Date: Thu, 19 Mar 2009 18:44:43 +0000 (-0700) Subject: parse_date: insist that it returns an int X-Git-Tag: allmydata-tahoe-1.4.0~42 X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/%22doc.html/banana.xhtml?a=commitdiff_plain;h=66fe8ca24c5da9d8642826a0bd9a3259f68d65b4;p=tahoe-lafs%2Ftahoe-lafs.git parse_date: insist that it returns an int --- diff --git a/src/allmydata/test/test_storage.py b/src/allmydata/test/test_storage.py index fa9d0664..032a6d24 100644 --- a/src/allmydata/test/test_storage.py +++ b/src/allmydata/test/test_storage.py @@ -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): diff --git a/src/allmydata/util/time_format.py b/src/allmydata/util/time_format.py index 0bc39280..bb935896 100644 --- a/src/allmydata/util/time_format.py +++ b/src/allmydata/util/time_format.py @@ -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"))