1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Use standardised datetime format

This commit is contained in:
Paulus Schoutsen
2016-04-16 00:55:35 -07:00
parent e7520ef401
commit 68d92c3196
29 changed files with 154 additions and 162 deletions

View File

@@ -128,7 +128,7 @@ class TestEvent(unittest.TestCase):
'event_type': event_type,
'data': data,
'origin': 'LOCAL',
'time_fired': dt_util.datetime_to_str(now),
'time_fired': now,
}
self.assertEqual(expected, event.as_dict())
@@ -225,13 +225,14 @@ class TestState(unittest.TestCase):
def test_repr(self):
"""Test state.repr."""
self.assertEqual("<state happy.happy=on @ 12:00:00 08-12-1984>",
self.assertEqual("<state happy.happy=on @ 1984-12-08T12:00:00+00:00>",
str(ha.State(
"happy.happy", "on",
last_changed=datetime(1984, 12, 8, 12, 0, 0))))
self.assertEqual(
"<state happy.happy=on; brightness=144 @ 12:00:00 08-12-1984>",
"<state happy.happy=on; brightness=144 @ "
"1984-12-08T12:00:00+00:00>",
str(ha.State("happy.happy", "on", {"brightness": 144},
datetime(1984, 12, 8, 12, 0, 0))))