Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions hcloud/helpers/descriptors.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
import arrow
from dateutil.parser import isoparse


class ISODateTime(object):
Expand All @@ -13,7 +13,5 @@ def __set__(self, obj, string_date):
if string_date is None:
self.val = None
else:
try:
self.val = arrow.get(string_date).datetime
except arrow.parser.ParserError:
raise ValueError('invalid date format')
# 2016-01-30T23:50+00:00
self.val = isoparse(string_date)
1 change: 0 additions & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
arrow==0.12.1
future==0.17.1
python-dateutil==2.7.5
recommonmark==0.4.0
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/volumes/test_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
import arrow
from dateutil.parser import isoparse
import mock

from hcloud.actions.client import BoundAction
Expand All @@ -24,7 +24,7 @@ def test_bound_volume_init(self, volume_response):
)

assert bound_volume.id == 1
assert bound_volume.created == arrow.get("2016-01-30T23:50:11+00:00").datetime
assert bound_volume.created == isoparse("2016-01-30T23:50:11+00:00")
assert bound_volume.name == "database-storage"
assert bound_volume.server == 12
assert bound_volume.size == 42
Expand Down