'Test conversion of entry to dict.'

def test_entry_to_dict(self):

    entry = logbook.Entry(dt_util.utcnow(), 'Alarm', 'is    triggered', 'switch', 'test_switch')
    data = entry.as_dict()
    self.assertEqual('Alarm', data.get(logbook.ATTR_NAME))
    self.assertEqual('is    triggered', data.get(logbook.ATTR_MESSAGE))
    self.assertEqual('switch', data.get(logbook.ATTR_DOMAIN))
    self.assertEqual('test_switch', data.get(logbook.ATTR_ENTITY_ID))
