Добавлено новое поле experiment в класс Status
このコミットが含まれているのは:
コミット
740730617a
|
@ -464,7 +464,8 @@ def track_position():
|
|||
def status(account, permissions, subscription, plus, station_data, alert):
|
||||
return Status(account, permissions, TestStatus.advertisement, subscription, TestStatus.cache_limit,
|
||||
TestStatus.subeditor, TestStatus.subeditor_level, plus, TestStatus.default_email,
|
||||
TestStatus.skips_per_hour, TestStatus.station_exists, station_data, alert, TestStatus.premium_region)
|
||||
TestStatus.skips_per_hour, TestStatus.station_exists, station_data, alert,
|
||||
TestStatus.premium_region, TestStatus.experiment)
|
||||
|
||||
|
||||
@pytest.fixture(scope='session')
|
||||
|
|
|
@ -10,6 +10,7 @@ class TestStatus:
|
|||
skips_per_hour = None
|
||||
station_exists = None
|
||||
premium_region = None
|
||||
experiment = 109
|
||||
|
||||
def test_expected_values(self, status, account, permissions, subscription, plus, alert):
|
||||
assert status.account == account
|
||||
|
@ -25,6 +26,7 @@ class TestStatus:
|
|||
assert status.station_exists == self.station_exists
|
||||
assert status.bar_below == alert
|
||||
assert status.premium_region == self.premium_region
|
||||
assert status.experiment == self.experiment
|
||||
|
||||
def test_de_json_none(self, client):
|
||||
assert Status.de_json({}, client) is None
|
||||
|
@ -42,7 +44,7 @@ class TestStatus:
|
|||
'subeditor': self.subeditor, 'subeditor_level': self.subeditor_level, 'plus': plus.to_dict(),
|
||||
'default_email': self.default_email, 'skips_per_hour': self.skips_per_hour,
|
||||
'station_exists': self.station_exists, 'premium_region': self.premium_region,
|
||||
'advertisement': self.advertisement, 'bar_below': alert.to_dict()}
|
||||
'advertisement': self.advertisement, 'bar_below': alert.to_dict(), 'experiment': self.experiment}
|
||||
status = Status.de_json(json_dict, client)
|
||||
|
||||
assert status.account == account
|
||||
|
@ -58,6 +60,7 @@ class TestStatus:
|
|||
assert status.station_exists == self.station_exists
|
||||
assert status.bar_below == alert
|
||||
assert status.premium_region == self.premium_region
|
||||
assert status.experiment == self.experiment
|
||||
|
||||
def test_equality(self, account, permissions, subscription):
|
||||
a = Status(account, permissions)
|
||||
|
|
|
@ -24,6 +24,7 @@ class Status(YandexMusicObject):
|
|||
station_data (:obj:`yandex_music.StationData`): Информация о личной станции.
|
||||
bar_below (:obj:`yandex_music.Alert`): Блок с предупреждениями о конце подписке и подарках.
|
||||
premium_region (:obj:`int`): Регион TODO.
|
||||
experiment (:obj:`int`): Включенная новая фича на аккаунте (её ID) TODO.
|
||||
client (:obj:`yandex_music.Client`): Клиент Yandex Music.
|
||||
|
||||
Args:
|
||||
|
@ -41,6 +42,7 @@ class Status(YandexMusicObject):
|
|||
station_data (:obj:`yandex_music.StationData`, optional): Информация о личной станции.
|
||||
bar_below (:obj:`yandex_music.Alert`, optional): Блок с предупреждениями о конце подписке и подарках.
|
||||
premium_region (:obj:`int`, optional): Регион TODO.
|
||||
experiment (:obj:`int`, optional): Включенная новая фича на аккаунте (её ID) TODO.
|
||||
client (:obj:`yandex_music.Client`, optional): Клиент Yandex Music.
|
||||
**kwargs: Произвольные ключевые аргументы полученные от API.
|
||||
"""
|
||||
|
@ -60,6 +62,7 @@ class Status(YandexMusicObject):
|
|||
station_data: Optional['StationData'] = None,
|
||||
bar_below: Optional['Alert'] = None,
|
||||
premium_region: Optional[int] = None,
|
||||
experiment: Optional[int] = None,
|
||||
client: Optional['Client'] = None,
|
||||
**kwargs) -> None:
|
||||
self.account = account
|
||||
|
@ -77,6 +80,7 @@ class Status(YandexMusicObject):
|
|||
self.station_data = station_data
|
||||
self.bar_below = bar_below
|
||||
self.premium_region = premium_region
|
||||
self.experiment = experiment
|
||||
|
||||
self.client = client
|
||||
self._id_attrs = (self.account, self.permissions)
|
||||
|
|
読み込み中…
新しいイシューから参照