'Test not publishing of MQTT messages with invalid code.'

def test_arm_home_not_publishes_mqtt_with_invalid_code(self):

    assert setup_component(self.hass, alarm_control_panel.DOMAIN, {alarm_control_panel.DOMAIN: {'platform': 'mqtt', 'name': 'test', 'state_topic': 'alarm/state', 'command_topic': 'alarm/command', 'code': '1234'}})
    call_count = self.mock_publish.call_count
    alarm_control_panel.alarm_arm_home(self.hass, 'abcd')
    self.hass.block_till_done()
    self.assertEqual(call_count, self.mock_publish.call_count)
