コード例 #1
0
ファイル: test_user_endpoints.py プロジェクト: pouxol/spotipy
    def setUpClass(self):
        if sys.version_info >= (3, 2):
            # >= Python3.2 only
            warnings.filterwarnings(
                "ignore",
                category=ResourceWarning,  # noqa
                message="unclosed.*<ssl.SSLSocket.*>")

        missing = list(filter(lambda var: not os.getenv(CCEV[var]), CCEV))

        if missing:
            raise Exception(
                ('Please set the client credentials for the test application'
                 ' using the following environment variables: {}').format(
                    CCEV.values()))

        self.username = os.getenv(CCEV['client_username'])

        self.scope = (
            'playlist-modify-public '
            'user-library-read '
            'user-follow-read '
            'user-library-modify '
            'user-read-private '
            'user-top-read '
            'user-follow-modify '
            'user-read-recently-played '
            'ugc-image-upload'
        )

        self.token = prompt_for_user_token(self.username, scope=self.scope)

        self.spotify = Spotify(auth=self.token)
コード例 #2
0
ファイル: test_auth.py プロジェクト: ritiek/spotipy
    def setUpClass(self):

        missing = list(filter(lambda var: not os.getenv(CCEV[var]), CCEV))

        if missing:
            raise Exception(
                ('Please set the client credentials for the test application'
                 ' using the following environment variables: {}').format(
                    CCEV.values()))

        self.username = os.getenv(CCEV['client_username'])

        self.scope = (
            'playlist-modify-public '
            'user-library-read '
            'user-follow-read '
            'user-library-modify '
            'user-read-private '
            'user-top-read '
            'user-follow-modify'
        )

        self.token = prompt_for_user_token(self.username, scope=self.scope)

        self.spotify = Spotify(auth=self.token)
コード例 #3
0
 def setUpClass(self):
     missing = list(filter(lambda var: not os.getenv(CCEV[var]), CCEV))
     if missing:
         raise Exception(('Please set the client credentials for the test '
                          'the following environment variables: {}').format(
                              CCEV.values()))
     self.username = os.getenv(CCEV['client_username'])
     self.scope = 'user-library-read'
     self.token = prompt_for_user_token(self.username, scope=self.scope)
     self.spotify = Spotify(
         client_credentials_manager=SpotifyClientCredentials())
コード例 #4
0
ファイル: tests.py プロジェクト: sanchitcop19/spotipy
    def setUpClass(self):
        missing = filter(lambda var: not os.getenv(CCEV[var]), CCEV)

        if missing:
            raise Exception(
                'Please set the client credentials for the test application using the following environment variables: {}'
                .format(CCEV.values()))

        self.username = os.getenv(CCEV['client_username'])

        self.scope = 'user-library-read'

        self.token = prompt_for_user_token(self.username, scope=self.scope)

        self.spotify = Spotify(auth=self.token)