'Test play preset 1.'

@mock.patch('libsoundtouch.device.SoundTouchDevice.select_preset')
@mock.patch('libsoundtouch.device.SoundTouchDevice.presets', side_effect=_mocked_presets)
@mock.patch('libsoundtouch.device.SoundTouchDevice.volume')
@mock.patch('libsoundtouch.device.SoundTouchDevice.status')
@mock.patch('libsoundtouch.soundtouch_device', side_effect=_mock_soundtouch_device)
def test_play_media(self, mocked_sountouch_device, mocked_status, mocked_volume, mocked_presets, mocked_select_preset):

    soundtouch.setup_platform(self.hass, default_component(), mock.MagicMock())
    all_devices = self.hass.data[soundtouch.DATA_SOUNDTOUCH]
    self.assertEqual(mocked_sountouch_device.call_count, 1)
    self.assertEqual(mocked_status.call_count, 1)
    self.assertEqual(mocked_volume.call_count, 1)
    all_devices[0].play_media('PLAYLIST', 1)
    self.assertEqual(mocked_presets.call_count, 1)
    self.assertEqual(mocked_select_preset.call_count, 1)
    all_devices[0].play_media('PLAYLIST', 2)
    self.assertEqual(mocked_presets.call_count, 2)
    self.assertEqual(mocked_select_preset.call_count, 1)
