Skip to content

Commit 0d1acd1

Browse files
committed
Passing another test. Fixed the separator to be any character
1 parent f611e90 commit 0d1acd1

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Diff for: adafruit_datetime.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,11 @@ def tzinfo(self):
12621262
"""
12631263
return self._tzinfo
12641264

1265+
@property
1266+
def fold(self):
1267+
"""Fold."""
1268+
return self._fold
1269+
12651270
# Class methods
12661271

12671272
# pylint: disable=protected-access
@@ -1311,8 +1316,10 @@ def fromisoformat(cls, date_string):
13111316
Valid format is ``YYYY-MM-DD[*HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]]]``
13121317
13131318
"""
1314-
if "T" in date_string:
1315-
date_string, time_string = date_string.split("T")
1319+
time_string = None
1320+
if len(date_string) > 10:
1321+
time_string = date_string[11:]
1322+
date_string = date_string[:10]
13161323
dateval = date.fromisoformat(date_string)
13171324
timeval = time.fromisoformat(time_string)
13181325
else:

Diff for: tests/test_datetime.py

-2
Original file line numberDiff line numberDiff line change
@@ -1033,8 +1033,6 @@ def __new__(cls, *args, **kwargs):
10331033
self.assertIsInstance(dt, DateTimeSubclass)
10341034
self.assertEqual(dt.extra, 7)
10351035

1036-
# TODO
1037-
@unittest.skip("timezone not implemented")
10381036
def test_fromisoformat_datetime(self):
10391037
# Test that isoformat() is reversible
10401038
base_dates = [(1, 1, 1), (1900, 1, 1), (2004, 11, 12), (2017, 5, 30)]

0 commit comments

Comments
 (0)