Добавлены поля pretrial_active и userhash классу Status.

このコミットが含まれているのは:
Kozhevnikov Andrey 2022-11-11 23:53:24 +07:00 committed by GitHub
コミット 10ec9efde9
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 4AEE18F83AFDEB23
3個のファイルの変更14行の追加0行の削除

ファイルの表示

@ -999,6 +999,8 @@ def status(account, permissions, subscription, plus, station_data, alert):
alert,
TestStatus.premium_region,
TestStatus.experiment,
TestStatus.pretrial_active,
TestStatus.userhash,
)

ファイルの表示

@ -11,6 +11,8 @@ class TestStatus:
station_exists = None
premium_region = None
experiment = 109
userhash = '2a1d970ce4dadc3333280aa8727d1c41a380a7622521ecef67928cd4213adb8f'
pretrial_active = False
def test_expected_values(self, status, account, permissions, subscription, plus, alert):
assert status.account == account
@ -27,6 +29,8 @@ class TestStatus:
assert status.bar_below == alert
assert status.premium_region == self.premium_region
assert status.experiment == self.experiment
assert status.userhash == self.userhash
assert status.pretrial_active == self.pretrial_active
def test_de_json_none(self, client):
assert Status.de_json({}, client) is None
@ -54,6 +58,8 @@ class TestStatus:
'advertisement': self.advertisement,
'bar_below': alert.to_dict(),
'experiment': self.experiment,
'userhash': self.userhash,
'pretrial_active': self.pretrial_active,
}
status = Status.de_json(json_dict, client)
@ -71,6 +77,8 @@ class TestStatus:
assert status.bar_below == alert
assert status.premium_region == self.premium_region
assert status.experiment == self.experiment
assert status.userhash == self.userhash
assert status.pretrial_active == self.pretrial_active
def test_equality(self, account, permissions, subscription):
a = Status(account, permissions)

ファイルの表示

@ -27,6 +27,8 @@ class Status(YandexMusicObject):
bar_below (:obj:`yandex_music.Alert`, optional): Блок с предупреждениями о конце подписке и подарках.
premium_region (:obj:`int`, optional): Регион TODO.
experiment (:obj:`int`, optional): Включенная новая фича на аккаунте (её ID) TODO.
pretrial_active (:obj:`bool`, optional): TODO.
userhash (:obj:`str`, optional): Хэш-код идентификатора пользователя.
client (:obj:`yandex_music.Client`, optional): Клиент Yandex Music.
"""
@ -45,6 +47,8 @@ class Status(YandexMusicObject):
bar_below: Optional['Alert'] = None
premium_region: Optional[int] = None
experiment: Optional[int] = None
pretrial_active: Optional[bool] = None
userhash: Optional[str] = None
client: Optional['Client'] = None
def __post_init__(self):