yandex-music-api/tests/test_track_with_ads.py

35 行
1.0 KiB
Python

from yandex_music import TrackWithAds
class TestTrackWithAds:
type = 'track'
def test_expected_values(self, track_with_ads, track):
assert track_with_ads.type == self.type
assert track_with_ads.track == track
def test_de_json_required(self, client, track):
json_dict = {'type_': self.type, 'track': track.to_dict()}
track_with_ads = TrackWithAds.de_json(json_dict, client)
assert track_with_ads.type == self.type
assert track_with_ads.track == track
def test_de_json_all(self, client, track):
json_dict = {'type_': self.type, 'track': track.to_dict()}
track_with_ads = TrackWithAds.de_json(json_dict, client)
assert track_with_ads.type == self.type
assert track_with_ads.track == track
def test_equality(self, track):
a = TrackWithAds(self.type, track)
b = TrackWithAds('', track)
c = TrackWithAds(self.type, track)
assert a != b
assert hash(a) != hash(b)
assert a is not b
assert a == c