Compare commits

..

1 Commits

Author SHA1 Message Date
Timo Furrer 77e6249287 Test on Linux and OSX 2018-05-14 13:55:20 +02:00
4 changed files with 7 additions and 10 deletions
+4
View File
@@ -1,4 +1,8 @@
language: python
os:
- linux
- osx
python:
- "2.7"
- "3.6"
+1 -1
View File
@@ -1 +1 @@
__version__ = '0.4.3'
__version__ = '0.4.2'
+1 -1
View File
@@ -277,7 +277,7 @@ class MayaDT(object):
def rfc3339(self):
"""Returns an RFC 3339 representation of the MayaDT."""
return self.datetime().strftime("%Y-%m-%dT%H:%M:%S.%f")[:-5] + "Z"
return self.datetime().strftime("%Y-%m-%dT%H:%M:%S.%f")[:-4] + "Z"
# Properties
# ----------
+1 -8
View File
@@ -239,20 +239,13 @@ def test_datetime_to_timezone():
assert dt.tzinfo.zone == 'US/Eastern'
def test_rfc3339_epoch():
def test_rfc3339():
mdt = maya.when('2016-01-01')
out = mdt.rfc3339()
mdt2 = maya.MayaDT.from_rfc3339(out)
assert mdt.epoch == mdt2.epoch
def test_rfc3339_format():
rfc3339 = maya.MayaDT.rfc3339(maya.when('2016-01-01T12:03:03Z'))
# it's important that the string has got a "max 1-digit millis" fragment
# as per https://tools.ietf.org/html/rfc3339#section-5.6
assert rfc3339 == '2016-01-01T12:03:03.0Z'
@pytest.mark.usefixtures("frozen_now")
def test_comparison_operations():
now = maya.now()