MCPcopy
hub / github.com/beetbox/beets / test_missing_request

Method test_missing_request

test/plugins/test_spotify.py:60–89  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

58
59 @responses.activate
60 def test_missing_request(self):
61 json_file = os.path.join(
62 _common.RSRC, b"spotify", b"missing_request.json"
63 )
64 with open(json_file, "rb") as f:
65 response_body = f.read()
66
67 responses.add(
68 responses.GET,
69 spotify.SpotifyPlugin.search_url,
70 body=response_body,
71 status=200,
72 content_type="application/json",
73 )
74 item = Item(
75 mb_trackid="01234",
76 album="lkajsdflakjsd",
77 albumartist="ujydfsuihse",
78 title="duifhjslkef",
79 length=10,
80 )
81 item.add(self.lib)
82 assert [] == self.spotify._match_library_tracks(self.lib, "")
83
84 params = _params(responses.calls[0].request.url)
85 query = params["q"][0]
86 assert "duifhjslkef" in query
87 assert "artist:'ujydfsuihse'" in query
88 assert "album:'lkajsdflakjsd'" in query
89 assert params["type"] == ["track"]
90
91 @responses.activate
92 def test_track_request(self):

Callers

nothing calls this directly

Calls 6

ItemClass · 0.90
_paramsFunction · 0.85
joinMethod · 0.80
_match_library_tracksMethod · 0.80
readMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected