oauth: fix string returned by setup_oauth to include expires_in
This commit is contained in:
parent
2825e734c5
commit
8aee43837b
2 changed files with 20 additions and 13 deletions
|
|
@ -37,9 +37,6 @@ class TestYTMusic(unittest.TestCase):
|
|||
assert isinstance(yt, YTMusic)
|
||||
cls.yt = YTMusic()
|
||||
cls.yt_oauth = YTMusic(headers_oauth)
|
||||
with open(headers_oauth, mode="r", encoding="utf8") as headers:
|
||||
string_headers = headers.read()
|
||||
cls.yt_oauth = YTMusic(string_headers)
|
||||
cls.yt_auth = YTMusic(headers_browser)
|
||||
cls.yt_brand = YTMusic(config["auth"]["headers"], config["auth"]["brand_account"])
|
||||
cls.yt_empty = YTMusic(config["auth"]["headers_empty"],
|
||||
|
|
@ -54,7 +51,6 @@ class TestYTMusic(unittest.TestCase):
|
|||
headers = main()
|
||||
self.assertGreaterEqual(len(headers), 2)
|
||||
|
||||
# @unittest.skip("Cannot test oauth flow non-interactively")
|
||||
@mock.patch("requests.Response.json")
|
||||
@mock.patch("requests.Session.post")
|
||||
@mock.patch("sys.argv", ["ytmusicapi", "oauth", "--file", headers_oauth])
|
||||
|
|
@ -68,6 +64,11 @@ class TestYTMusic(unittest.TestCase):
|
|||
main()
|
||||
self.assertTrue(Path(headers_oauth).exists())
|
||||
|
||||
json_mock.side_effect = None
|
||||
with open(headers_oauth, mode="r", encoding="utf8") as headers:
|
||||
string_headers = headers.read()
|
||||
self.yt_oauth = YTMusic(string_headers)
|
||||
|
||||
###############
|
||||
# BROWSING
|
||||
###############
|
||||
|
|
|
|||
Loading…
Reference in a new issue