'Ensuring soco methods called for sonos_group_players service.'

@mock.patch('soco.SoCo', new=SoCoMock)
@mock.patch('socket.create_connection', side_effect=socket.error())
@mock.patch.object(SoCoMock, 'join')
def test_sonos_group_players(self, join_mock, *args):

    sonos.setup_platform(self.hass, {}, fake_add_device, {'host': '192.0.2.1'})
    device = self.hass.data[sonos.DATA_SONOS][(-1)]
    device.hass = self.hass
    device_master = mock.MagicMock()
    device_master.entity_id = 'media_player.test'
    device_master.soco_device = mock.MagicMock()
    self.hass.data[sonos.DATA_SONOS].append(device_master)
    join_mock.return_value = True
    device.join('media_player.test')
    self.assertEqual(join_mock.call_count, 1)
