def test_equality(self, track): a = SimilarTracks(track, [track]) b = SimilarTracks(None, [track]) c = SimilarTracks(track, [track]) assert a != b assert hash(a) != hash(b) assert a is not b assert a == c
def test_de_json_all(self, client, track): json_dict = { 'track': track.to_dict(), 'similar_tracks': [track.to_dict()] } similar_tracks = SimilarTracks.de_json(json_dict, client) assert similar_tracks.track == track assert similar_tracks.similar_tracks == [track]
def similar_tracks(track): return SimilarTracks(track, [track])
def test_de_json_none(self, client): assert SimilarTracks.de_json({}, client) is None