示例#1
0
    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
示例#2
0
    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]
示例#3
0
def similar_tracks(track):
    return SimilarTracks(track, [track])
示例#4
0
 def test_de_json_none(self, client):
     assert SimilarTracks.de_json({}, client) is None