'Test the JSON Encoder.'

def test_json_encoder(self):

    ha_json_enc = remote.JSONEncoder()
    state = hass.states.get('test.test')
    self.assertEqual(state.as_dict(), ha_json_enc.default(state))
    self.assertRaises(TypeError, ha_json_enc.default, 1)
    now = dt_util.utcnow()
    self.assertEqual(now.isoformat(), ha_json_enc.default(now))
