'Test next/previous track.'

@mock.patch('libsoundtouch.device.SoundTouchDevice.previous_track')
@mock.patch('libsoundtouch.device.SoundTouchDevice.next_track')
@mock.patch('libsoundtouch.device.SoundTouchDevice.volume')
@mock.patch('libsoundtouch.device.SoundTouchDevice.status')
@mock.patch('libsoundtouch.soundtouch_device', side_effect=_mock_soundtouch_device)
def test_next_previous_track(self, mocked_sountouch_device, mocked_status, mocked_volume, mocked_next_track, mocked_previous_track):

    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].media_next_track()
    self.assertEqual(mocked_status.call_count, 2)
    self.assertEqual(mocked_next_track.call_count, 1)
    all_devices[0].media_previous_track()
    self.assertEqual(mocked_status.call_count, 3)
    self.assertEqual(mocked_previous_track.call_count, 1)
