Пример #1
0
    def test_caches_results(self, sp_artist_mock):
        ref1 = translator.to_artist_ref(sp_artist_mock)
        ref2 = translator.to_artist_ref(sp_artist_mock)

        assert ref1 is ref2
Пример #2
0
    def test_successful_translation(self, sp_artist_mock):
        ref = translator.to_artist_ref(sp_artist_mock)

        assert ref.type == 'artist'
        assert ref.uri == 'spotify:artist:abba'
        assert ref.name == 'ABBA'
Пример #3
0
    def test_returns_none_if_unloaded(self, sp_artist_mock):
        sp_artist_mock.is_loaded = False

        ref = translator.to_artist_ref(sp_artist_mock)

        assert ref is None
Пример #4
0
    def test_caches_results(self, sp_artist_mock):
        ref1 = translator.to_artist_ref(sp_artist_mock)
        ref2 = translator.to_artist_ref(sp_artist_mock)

        assert ref1 is ref2
Пример #5
0
    def test_successful_translation(self, sp_artist_mock):
        ref = translator.to_artist_ref(sp_artist_mock)

        assert ref.type == 'artist'
        assert ref.uri == 'spotify:artist:abba'
        assert ref.name == 'ABBA'
Пример #6
0
    def test_returns_none_if_unloaded(self, sp_artist_mock):
        sp_artist_mock.is_loaded = False

        ref = translator.to_artist_ref(sp_artist_mock)

        assert ref is None