Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Сделал поле uri класса Description опциональным #661

Merged
merged 2 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions tests/test_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ def test_de_json_none(self, client):
assert Description.de_json({}, client) is None

def test_de_json_required(self, client):
json_dict = {'text': self.text, 'uri': self.uri}
json_dict = {'text': self.text}
description = Description.de_json(json_dict, client)

assert description.text == self.text
assert description.uri == self.uri

def test_de_json_all(self, client):
json_dict = {'text': self.text, 'uri': self.uri}
Expand Down
4 changes: 2 additions & 2 deletions yandex_music/artist/description.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ class Description(YandexMusicModel):

Attributes:
text (:obj:`str`): Описание исполнителя.
uri (:obj:`str`): Ссылка на источник.
uri (:obj:`str`, optional): Ссылка на источник.
client (:obj:`yandex_music.Client`, optional): Клиент Yandex Music.
"""

text: str
uri: str
uri: Optional[str] = None
client: Optional['ClientType'] = None

def __post_init__(self) -> None:
Expand Down
Loading