def test_get_book_url_nouri(self): defaults = Defaults('http://FAKE.GLTD') api_url = defaults.get_book_url(12345) _, _, path, query, _ = urlsplit(api_url) assert path == "/book/show/12345.xml" assert query == "key=None"
def test_get_book_url(self): defaults = Defaults('http://FAKE.GLTD') api_url = defaults.get_book_url(12345, 'http://FAKE.GLTD/FAKER?id=%s&key=%s') _, _, path, query, _ = urlsplit(api_url) params = parse_qs(query) assert params['id'][0] == '12345' assert params['key'][0] == 'None'