Unverified Commit a7551e22 authored by Isis Lovecruft's avatar Isis Lovecruft
Browse files

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.
parent a9e65a0c
...@@ -91,6 +91,10 @@ class Unscheduled(object): ...@@ -91,6 +91,10 @@ class Unscheduled(object):
def getInterval(self, when=0): def getInterval(self, when=0):
"""Get the interval that contains the time **when**. """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 :param int when: The time which we're trying to find the corresponding
interval for. interval for.
:rtype: str :rtype: str
...@@ -98,8 +102,9 @@ class Unscheduled(object): ...@@ -98,8 +102,9 @@ class Unscheduled(object):
specificity depends on what type of interval we're using. For specificity depends on what type of interval we're using. For
example, if using ``"month"``, the return value would be something example, if using ``"month"``, the return value would be something
like ``"2013-12"``. 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): def nextIntervalStarts(self, when=0):
"""Return the start time of the interval starting _after_ when. """Return the start time of the interval starting _after_ when.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment