'"Test the receiving of the remotely fired event.'

def test_receiving_remote_event_fires_hass_event(self):

    sub_topic = 'foo'
    assert self.add_eventstream(sub_topic=sub_topic)
    self.hass.block_till_done()
    calls = []
    @callback
    def listener(_):
        calls.append(1)
    self.hass.bus.listen_once('test_event', listener)
    self.hass.block_till_done()
    payload = json.dumps({'event_type': 'test_event', 'event_data': {}}, cls=JSONEncoder)
    fire_mqtt_message(self.hass, sub_topic, payload)
    self.hass.block_till_done()
    assert (1 == len(calls))
