

def test_entry_to_dict(self):
    'Test conversion of entry to dict.'
    entry = logbook.Entry(dt_util.utcnow(), 'Alarm', 'is triggered', 'switch', 'test_switch')
    data = entry.as_dict()
    self.assertEqual('Alarm', data.get(logbook.ATTR_NAME))
    entry.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))

dataset/ETHPy150Open home-assistant/home-assistant/tests/components/test_logbook.py TestComponentHistory.test_entry_to_dict/VarMisuse@57/93 `self`->`entry`