mirror of
https://github.com/kennethreitz/maya.git
synced 2026-06-05 14:50:19 +00:00
Fix MayaInterval.iso8601()
This commit is contained in:
+1
-1
@@ -352,7 +352,7 @@ class MayaInterval(object):
|
||||
|
||||
def iso8601(self):
|
||||
"""Returns an ISO 8601 representation of the MayaInterval."""
|
||||
return '{0}/{1}'.format(self.start.iso6801, self.end.iso8601)
|
||||
return '{0}/{1}'.format(self.start.iso8601(), self.end.iso8601())
|
||||
|
||||
@classmethod
|
||||
def from_iso8601(cls, s):
|
||||
|
||||
@@ -582,3 +582,9 @@ def test_interval_from_datetime():
|
||||
)
|
||||
assert interval3.start == start
|
||||
assert interval3.end == end
|
||||
|
||||
|
||||
def test_interval_iso8601():
|
||||
start = maya.when('11-17-11 08:09:10')
|
||||
interval = maya.MayaInterval(start=start, duration=1)
|
||||
assert interval.iso8601() == '2011-11-17T08:09:10Z/2011-11-17T08:09:11Z'
|
||||
|
||||
Reference in New Issue
Block a user