'Test if message is fired on topic match.'

def test_if_fires_on_topic_match(self):

    assert setup_component(self.hass, automation.DOMAIN, {automation.DOMAIN: {'trigger': {'platform': 'mqtt', 'topic': 'test-topic'}, 'action': {'service': 'test.automation', 'data_template': {'some': '{{    trigger.platform    }}    -    {{    trigger.topic    }}    -    {{    trigger.payload    }}    -    {{    trigger.payload_json.hello    }}'}}}})
    fire_mqtt_message(self.hass, 'test-topic', '{    "hello":    "world"    }')
    self.hass.block_till_done()
    self.assertEqual(1, len(self.calls))
    self.assertEqual('mqtt    -    test-topic    -    {    "hello":    "world"    }    -    world', self.calls[0].data['some'])
    automation.turn_off(self.hass)
    self.hass.block_till_done()
    fire_mqtt_message(self.hass, 'test-topic', 'test_payload')
    self.hass.block_till_done()
    self.assertEqual(1, len(self.calls))
