Search issue 494 (#495)

* search_suggestions: fix handle history when authenticated

* search_suggestions: test historical option does something

* remove optional param

---------

Co-authored-by: sigma67 <ytmusicapi@gmail.com>
This commit is contained in:
John Birdwell 2023-12-31 06:16:48 -06:00 • committed by GitHub
commit 1971121add
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View file

@ -322,6 +322,15 @@ class TestYTMusic(unittest.TestCase):
result = self.yt.get_search_suggestions("fade", detailed_runs=True)
self.assertGreaterEqual(len(result), 0)
# add search term to history
first_pass = self.yt_auth.search("b")
self.assertGreater(len(first_pass), 0)
# get results
results = self.yt_auth.get_search_suggestions("b", detailed_runs=True)
self.assertGreater(len(results), 0)
self.assertTrue(any(item["fromHistory"] for item in results))
self.assertTrue(any(not item["fromHistory"] for item in results))
################
# EXPLORE
################