Skip to content

Commit

Permalink
Поле common_period_duration класса Product теперь опционально
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX committed Jun 20, 2023
1 parent 84deae4 commit a171583
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,13 +968,13 @@ def product(price, licence_text_part):
return Product(
TestProduct.product_id,
TestProduct.type,
TestProduct.common_period_duration,
TestProduct.duration,
TestProduct.trial_duration,
price,
TestProduct.feature,
TestProduct.debug,
TestProduct.plus,
price,
TestProduct.common_period_duration,
TestProduct.cheapest,
TestProduct.title,
TestProduct.family_sub,
Expand Down
5 changes: 0 additions & 5 deletions tests/test_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def test_de_json_required(self, client, price):
json_dict = {
'product_id': self.product_id,
'type': self.type,
'common_period_duration': self.common_period_duration,
'duration': self.duration,
'trial_duration': self.trial_duration,
'price': price.to_dict(),
Expand All @@ -81,7 +80,6 @@ def test_de_json_required(self, client, price):

assert product.product_id == self.product_id
assert product.type == self.type
assert product.common_period_duration == self.common_period_duration
assert product.duration == self.duration
assert product.trial_duration == self.trial_duration
assert product.price == price
Expand Down Expand Up @@ -157,7 +155,6 @@ def test_equality(self, price):
a = Product(
self.product_id,
self.type,
self.common_period_duration,
self.duration,
self.trial_duration,
price,
Expand All @@ -168,7 +165,6 @@ def test_equality(self, price):
b = Product(
'',
self.type,
self.common_period_duration,
self.duration,
self.trial_duration,
price,
Expand All @@ -179,7 +175,6 @@ def test_equality(self, price):
c = Product(
self.product_id,
self.type,
self.common_period_duration,
self.duration,
self.trial_duration,
price,
Expand Down
9 changes: 4 additions & 5 deletions yandex_music/account/product.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ class Product(YandexMusicObject):
Attributes:
product_id (:obj:`str`): Уникальный идентификатор.
type (:obj:`str`): Тип продаваемого.
common_period_duration (:obj:`str`): Длительность общего периода.
duration (:obj:`int`): Длительность.
trial_duration (:obj:`int`): Длительность испытательного срока.
price (:obj:`yandex_music.Price`): Цена.
feature (:obj:`str`): Предоставляемая возможность.
debug (:obj:`bool`): Отладочный продукт.
plus (:obj:`bool`): Даёт ли подписку "Плюс".
price (:obj:`yandex_music.Price`, optional): Цена.
common_period_duration (:obj:`str`, optional): Длительность общего периода.
cheapest (:obj:`bool`, optional): Самый дешёвый (лучшее предложение).
title (:obj:`str`, optional): Заголовок продукта.
family_sub (:obj:`bool`, optional): Семейная ли подписка.
Expand All @@ -47,13 +47,13 @@ class Product(YandexMusicObject):

product_id: str
type: str
common_period_duration: str
duration: int
trial_duration: int
price: Optional['Price']
feature: str
debug: bool
plus: bool
price: Optional['Price'] = None
common_period_duration: Optional[str] = None
cheapest: Optional[bool] = None
title: Optional[str] = None
family_sub: Optional[bool] = None
Expand All @@ -80,7 +80,6 @@ def __post_init__(self):
self._id_attrs = (
self.product_id,
self.type,
self.common_period_duration,
self.duration,
self.trial_duration,
self.product_id,
Expand Down

0 comments on commit a171583

Please sign in to comment.