Skip to content

Commit

Permalink
Сделал поле uri класса Description опциональным (#661)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninnjah authored Oct 30, 2024
1 parent 1c8619d commit 2a09dcb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
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

0 comments on commit 2a09dcb

Please sign in to comment.