Skip to content

Commit

Permalink
Make country codes as an importable file in client.py; remove audiobo…
Browse files Browse the repository at this point in the history
…ok functionality as it returns an error
  • Loading branch information
z3nrider committed May 22, 2024
1 parent 939b755 commit 3d1b661
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions tests/integration/non_user_endpoints/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,30 +464,6 @@ def test_available_markets(self):
self.assertIn("US", markets)
self.assertIn("GB", markets)

def test_get_audiobook(self):
audiobook = self.spotify.get_audiobook(self.american_gods_urn, market="US")
print(audiobook)
self.assertTrue(audiobook['name'] ==
'American Gods: The Tenth Anniversary Edition: A Novel')

def test_get_audiobook_bad_urn(self):
with self.assertRaises(SpotifyException):
self.spotify.get_audiobook("bogus_urn", market="US")

def test_get_audiobooks(self):
results = self.spotify.get_audiobooks(self.four_books, market="US")
self.assertTrue('audiobooks' in results)
self.assertTrue(len(results['audiobooks']) == 4)
self.assertTrue(results['audiobooks'][0]['name'] ==
'American Gods: The Tenth Anniversary Edition: A Novel')
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'] == 'Pachinko: A Novel')

def test_get_audiobook_chapters(self):
results = self.spotify.get_audiobook_chapters(
self.american_gods_urn, market="US", limit=10, offset=5)
self.assertTrue('items' in results)
self.assertTrue(len(results['items']) == 10)
self.assertTrue(results['items'][0]['chapter_number'] == 5)
self.assertTrue(results['items'][9]['chapter_number'] == 14)
if __name__ == '__main__':
unittest.main()

0 comments on commit 3d1b661

Please sign in to comment.