MCPcopy
hub / github.com/spotipy-dev/spotipy / test_cache_handler

Method test_cache_handler

tests/unit/test_oauth.py:155–163  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

153 self.assertTrue(fi.write.called)
154
155 def test_cache_handler(self):
156 scope = "playlist-modify-private"
157 tok = _make_fake_token(1, 1, scope)
158
159 spot = _make_oauth(scope, cache_handler=MemoryCacheHandler())
160 spot.cache_handler.save_token_to_cache(tok)
161 cached_tok = spot.cache_handler.get_cached_token()
162
163 self.assertEqual(tok, cached_tok)
164
165
166class TestSpotifyOAuthGetAuthorizeUrl(unittest.TestCase):

Callers

nothing calls this directly

Calls 5

MemoryCacheHandlerClass · 0.90
_make_fake_tokenFunction · 0.85
_make_oauthFunction · 0.85
save_token_to_cacheMethod · 0.45
get_cached_tokenMethod · 0.45

Tested by

no test coverage detected