mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 17:55:18 +02:00
Fixed #4: can now import artists and releases with a clean interface :party:
This commit is contained in:
parent
3ccb70d0a8
commit
aa80bd15fa
43 changed files with 1614 additions and 120 deletions
17
api/funkwhale_api/musicbrainz/tests/test_cache.py
Normal file
17
api/funkwhale_api/musicbrainz/tests/test_cache.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
import unittest
|
||||
from test_plus.test import TestCase
|
||||
|
||||
from funkwhale_api.musicbrainz import client
|
||||
|
||||
|
||||
class TestAPI(TestCase):
|
||||
def test_can_search_recording_in_musicbrainz_api(self, *mocks):
|
||||
r = {'hello': 'world'}
|
||||
mocked = 'funkwhale_api.musicbrainz.client._api.search_artists'
|
||||
with unittest.mock.patch(mocked, return_value=r) as m:
|
||||
self.assertEqual(client.api.artists.search('test'), r)
|
||||
# now call from cache
|
||||
self.assertEqual(client.api.artists.search('test'), r)
|
||||
self.assertEqual(client.api.artists.search('test'), r)
|
||||
|
||||
self.assertEqual(m.call_count, 1)
|
Loading…
Add table
Add a link
Reference in a new issue