@mock.patch('mficlient.client.MFiClient')
    @mock.patch('homeassistant.components.switch.mfi.MfiSwitch')
    def test_setup_adds_proper_devices(self, mock_switch, mock_client):
        """Test if setup adds devices."""
        ports = {i: mock.MagicMock(model=model)
                 for i, model in enumerate(mfi.SWITCH_MODELS)}
        ports['bad'] = mock.MagicMock(model='notaswitch')
        print(ports['bad'].model)
        mock_client.return_value.get_devices.return_value = \
            [mock.MagicMock(ports=ports)]
        assert self.COMPONENT.setup(self.hass, self.GOOD_CONFIG)
        for ident, port in ports.items():
            if ident != 'bad':
                mock_switch.assert_any_call(port)
        assert mock.call(ports['bad'], self.hass) not in mock_switch.mock_calls
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/switch/test_mfi.py/TestMfiSwitchSetup.test_setup_adds_proper_devices/original