[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [bridgedb/develop] Fix bug shown in test_Unscheduled_getInterval_is_constant() unittest.



commit a7551e22cc141d48bd7498afcc07d4378c0c0fcc
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Wed Jul 16 04:13:30 2014 +0000

    Fix bug shown in test_Unscheduled_getInterval_is_constant() unittest.
    
     * FIXES an additional problem for #12147 pointed out by Robert Ransom's
       `bridgedb.test.test_Unscheduled_getInterval_is_constant()` unittest.
---
 lib/bridgedb/schedule.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/bridgedb/schedule.py b/lib/bridgedb/schedule.py
index 6cef1a6..930f2e7 100644
--- a/lib/bridgedb/schedule.py
+++ b/lib/bridgedb/schedule.py
@@ -91,6 +91,10 @@ class Unscheduled(object):
     def getInterval(self, when=0):
         """Get the interval that contains the time **when**.
 
+        .. note: We explicitly ignore the ``when`` parameter in this
+            implementation because if something is Unscheduled then
+            all timestamps should reside within the same period.
+
         :param int when: The time which we're trying to find the corresponding
             interval for.
         :rtype: str
@@ -98,8 +102,9 @@ class Unscheduled(object):
             specificity depends on what type of interval we're using. For
             example, if using ``"month"``, the return value would be something
             like ``"2013-12"``.
+
         """
-        return fromUnixSeconds(when).strftime('%04Y-%02m-%02d %02H:%02M:%02S')
+        return fromUnixSeconds(0).strftime('%04Y-%02m-%02d %02H:%02M:%02S')
 
     def nextIntervalStarts(self, when=0):
         """Return the start time of the interval starting _after_ when.



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits