]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
parse_date: insist that it returns an int
authorBrian Warner <warner@allmydata.com>
Thu, 19 Mar 2009 18:44:43 +0000 (11:44 -0700)
committerBrian Warner <warner@allmydata.com>
Thu, 19 Mar 2009 18:44:43 +0000 (11:44 -0700)
src/allmydata/test/test_storage.py
src/allmydata/util/time_format.py

index fa9d06640e84109da85532f779adae1d5b930742..032a6d24e006fe647bd827dd564f6288d3aff793 100644 (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):
index 0bc3928062274e13fc0f0ced230e4286963c0892..bb935896087b116371bef8d1b6dc3f7727f14f3b 100644 (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"))