Skip to content

Commit

Permalink
Fix markets
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanebruckert committed Jun 23, 2024
1 parent 38ff088 commit 7f028ac
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions tests/integration/non_user_endpoints/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@ class AuthTestSpotipy(unittest.TestCase):
heavyweight_ep1_url = 'https://open.spotify.com/episode/68kq3bNz6hEuq8NtdfwERG'
reply_all_ep1_urn = 'spotify:episode:1KHjbpnmNpFmNTczQmTZlR'

# The following audiobooks are currently available in the GB market
# but might not be in other markets
dune_urn = 'spotify:audiobook:7iHfbu1YPACw6oZPAFJtqe'
dune_id = '7iHfbu1YPACw6oZPAFJtqe'
dune_url = 'https://open.spotify.com/audiobook/7iHfbu1YPACw6oZPAFJtqe'

four_books = [
'spotify:audiobook:7iHfbu1YPACw6oZPAFJtqe',
'spotify:audiobook:37sRC6carIX2Vf3Vv716T7',
'spotify:audiobook:1Gep4UJ95xQawA55OgRI8n',
'spotify:audiobook:18yVqkdbdRvS24c0Ilj2ci']
'spotify:audiobook:67VtmjZitn25TWocsyAEyh',
'spotify:audiobook:06huRZtBf5vArKHydJI80C',
'spotify:audiobook:6LtiFKiudPhwEmxpLatuGx']

@classmethod
def setUpClass(self):
Expand Down Expand Up @@ -485,7 +486,7 @@ def test_available_markets(self):
self.assertIn("GB", markets)

def test_get_audiobook(self):
audiobook = self.spotify.get_audiobook(self.dune_urn, market="US")
audiobook = self.spotify.get_audiobook(self.dune_urn)
self.assertTrue(audiobook['name'] ==
'Dune: Book One in the Dune Chronicles')

Expand All @@ -494,14 +495,17 @@ def test_get_audiobook_bad_urn(self):
self.spotify.get_audiobook("bogus_urn", market="US")

def test_get_audiobooks(self):
results = self.spotify.get_audiobooks(self.four_books, market="US")
results = self.spotify.get_audiobooks(self.four_books)
self.assertTrue('audiobooks' in results)
self.assertTrue(len(results['audiobooks']) == 4)
self.assertTrue(results['audiobooks'][0]['name']
== 'Dune: Book One in the Dune Chronicles')
self.assertTrue(results['audiobooks'][1]['name'] == 'The Da Vinci Code: A Novel')
self.assertTrue(results['audiobooks'][2]['name'] == 'Outlander')
self.assertTrue(results['audiobooks'][3]['name'] == 'The Fifth Season: Booktrack Edition')
self.assertTrue(results['audiobooks'][1]['name'] == 'The Helper')
self.assertTrue(results['audiobooks'][2]['name'] == 'Lies and Weddings')
self.assertTrue(results['audiobooks'][3]['name'] ==
('Alastair Campbell Talks Politics: An unmissable, new, illustrated '
'non-fiction book about politics and government for young people '
'for 2024 (Talks)'))

def test_get_audiobook_chapters(self):
results = self.spotify.get_audiobook_chapters(
Expand Down

0 comments on commit 7f028ac

Please sign in to comment.