* implement get_account_info to provide information about the authenticated user's account (#556) * Apply suggestions from code review to tests/README.rst Co-authored-by: sigma67 <16363825+sigma67@users.noreply.github.com> * simplify get_account_info by moving code out of parsers.py and navigation.py * test with non-auth account * format * update .pre-commit-config.yaml --------- Co-authored-by: sigma67 <16363825+sigma67@users.noreply.github.com> Co-authored-by: sigma67 <sigma67.github@gmail.com>
This commit is contained in:
parent
13701c40b7
commit
c412d7ce34
6 changed files with 60 additions and 1 deletions
|
|
@ -1,3 +1,5 @@
|
|||
from urllib.parse import urlparse
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
|
|
@ -109,3 +111,12 @@ class TestLibrary:
|
|||
def test_subscribe_artists(self, yt_auth):
|
||||
yt_auth.subscribe_artists(["UCUDVBtnOQi4c7E8jebpjc9Q"])
|
||||
yt_auth.unsubscribe_artists(["UCUDVBtnOQi4c7E8jebpjc9Q"])
|
||||
|
||||
def test_get_account_info(self, config, yt, yt_oauth):
|
||||
with pytest.raises(Exception, match="Please provide authentication"):
|
||||
yt.get_account_info()
|
||||
|
||||
account_info = yt_oauth.get_account_info()
|
||||
assert account_info["accountName"] == config.get("auth", "account_name")
|
||||
assert account_info["channelHandle"] == config.get("auth", "channel_handle")
|
||||
assert bool(urlparse(account_info["accountPhotoUrl"]))
|
||||
|
|
|
|||
Loading…
Reference in a new issue