'Test setup when connection succeeds.'

def test_setup_connected(self):

    with patch.multiple('pmsensor.co2sensor', read_mh_z19=DEFAULT, read_mh_z19_with_temperature=DEFAULT):
        from pmsensor.co2sensor import read_mh_z19_with_temperature
        read_mh_z19_with_temperature.return_value = None
        mock_add = Mock()
        self.assertTrue(mhz19.setup_platform(self.hass, {'platform': 'mhz19', 'monitored_conditions': ['co2', 'temperature'], mhz19.CONF_SERIAL_DEVICE: 'test.serial'}, mock_add))
    self.assertEqual(1, mock_add.call_count)
