Added direct_post and direct_get to api object. Useful for sending direct calls to post and get requests without using the path builder

This commit is contained in:
2019-05-20 11:17:12 -05:00
parent c6b15c7f7b
commit 4c264da3e0
2 changed files with 25 additions and 3 deletions

View File

@@ -56,6 +56,12 @@ class testApi(unittest.TestCase):
track["listen_url"] = url
self.assertRaises(ValueError, api.full_url, track["listen_url"])
def test_full_urls_support(self):
""" Testing support for passing full URLS instead of having to build those by the API wrapper. """
api = self.session.get_api()
tracks = api.tracks.get(page_size=1)
url = tracks["next"]
next_tracks = api.direct_get(url)
if __name__ == "__main__":
unittest.main()