# Path: spotifyconnect/utils.py
# PY2 = sys.version_info[0] == 2
# class EventEmitter(object):
# class _Listener(collections.namedtuple(
#         'Listener', ['callback', 'user_args'])):
# class IntEnum(int):
#     def __init__(self):
#     def on(self, event, listener, *user_args):
#     def off(self, event=None, listener=None):
#     def emit(self, event, *event_args):
#     def num_listeners(self, event=None):
#     def call(self, event, *event_args):
#     def __new__(cls, value):
#     def __repr__(self):
#     def add(cls, name, value):
# def make_enum(lib_prefix, enum_prefix=''):
#     def wrapper(cls):
# def to_bytes(value):
# def to_bytes_or_none(value):
# def to_char(value):
# def to_char_or_null(value):
# def to_unicode(value):
# def to_unicode_or_none(value):


import unittest
import spotifyconnect
from spotifyconnect import utils
        self.assertEqual(spotifyconnect.ErrorType.NullArgument, 4)
        self.assertEqual(spotifyconnect.ErrorType.InvalidArgument, 5)
        self.assertEqual(spotifyconnect.ErrorType.Uninitialized, 6)
        self.assertEqual(spotifyconnect.ErrorType.AlreadyInitialized, 7)
        self.assertEqual(spotifyconnect.ErrorType.LoginBadCredentials, 8)
        self.assertEqual(spotifyconnect.ErrorType.NeedsPremium, 9)
        self.assertEqual(spotifyconnect.ErrorType.TravelRestriction, 10)
        self.assertEqual(spotifyconnect.ErrorType.ApplicationBanned, 11)
        self.assertEqual(spotifyconnect.ErrorType.GeneralLoginError, 12)
        self.assertEqual(spotifyconnect.ErrorType.Unsupported, 13)
        self.assertEqual(spotifyconnect.ErrorType.NotActiveDevice, 14)
        self.assertEqual(spotifyconnect.ErrorType.PlaybackErrorStart, 1000)
        self.assertEqual(spotifyconnect.ErrorType.GeneralPlaybackError, 1001)
        self.assertEqual(spotifyconnect.ErrorType.PlaybackRateLimited, 1002)
        self.assertEqual(spotifyconnect.ErrorType.Unknown, 1003)


class TimeoutTest(unittest.TestCase):

    def test_is_an_error(self):
        error = spotifyconnect.Timeout(0.5)
        self.assertIsInstance(error, spotifyconnect.Error)

    def test_has_useful_repr(self):
        error = spotifyconnect.Timeout(0.5)
        self.assertIn('Operation did not complete in 0.500s', repr(error))

    def test_has_useful_string_representation(self):
        error = spotifyconnect.Timeout(0.5)
        self.assertEqual('%s' % error, 'Operation did not complete in 0.500s')

# Path: spotifyconnect/utils.py
# PY2 = sys.version_info[0] == 2
# class EventEmitter(object):
# class _Listener(collections.namedtuple(
#         'Listener', ['callback', 'user_args'])):
# class IntEnum(int):
#     def __init__(self):
#     def on(self, event, listener, *user_args):
#     def off(self, event=None, listener=None):
#     def emit(self, event, *event_args):
#     def num_listeners(self, event=None):
#     def call(self, event, *event_args):
#     def __new__(cls, value):
#     def __repr__(self):
#     def add(cls, name, value):
# def make_enum(lib_prefix, enum_prefix=''):
#     def wrapper(cls):
# def to_bytes(value):
# def to_bytes_or_none(value):
# def to_char(value):
# def to_char_or_null(value):
# def to_unicode(value):
# def to_unicode_or_none(value):


# Path: tests/test_error.py
import unittest
import spotifyconnect
from spotifyconnect import utils

        self.assertEqual(spotifyconnect.ErrorType.NullArgument, 4)
        self.assertEqual(spotifyconnect.ErrorType.InvalidArgument, 5)
        self.assertEqual(spotifyconnect.ErrorType.Uninitialized, 6)
        self.assertEqual(spotifyconnect.ErrorType.AlreadyInitialized, 7)
        self.assertEqual(spotifyconnect.ErrorType.LoginBadCredentials, 8)
        self.assertEqual(spotifyconnect.ErrorType.NeedsPremium, 9)
        self.assertEqual(spotifyconnect.ErrorType.TravelRestriction, 10)
        self.assertEqual(spotifyconnect.ErrorType.ApplicationBanned, 11)
        self.assertEqual(spotifyconnect.ErrorType.GeneralLoginError, 12)
        self.assertEqual(spotifyconnect.ErrorType.Unsupported, 13)
        self.assertEqual(spotifyconnect.ErrorType.NotActiveDevice, 14)
        self.assertEqual(spotifyconnect.ErrorType.PlaybackErrorStart, 1000)
        self.assertEqual(spotifyconnect.ErrorType.GeneralPlaybackError, 1001)
        self.assertEqual(spotifyconnect.ErrorType.PlaybackRateLimited, 1002)
        self.assertEqual(spotifyconnect.ErrorType.Unknown, 1003)


class TimeoutTest(unittest.TestCase):

    def test_is_an_error(self):
        error = spotifyconnect.Timeout(0.5)
        self.assertIsInstance(error, spotifyconnect.Error)

    def test_has_useful_repr(self):
        error = spotifyconnect.Timeout(0.5)
        self.assertIn('Operation did not complete in 0.500s', repr(error))

    def test_has_useful_string_representation(self):
        error = spotifyconnect.Timeout(0.5)
        self.assertEqual('%s' % error, 'Operation did not complete in 0.500s')

        self.assertIsInstance('%s' % error, utils.text_type)