Beispiel #1
0
    def test_get_search_url_nouri(self):
        defaults = Defaults('http://FAKE.GLTD')

        api_url = defaults.get_search_url(54321)
        _, _, path, query, _ = urlsplit(api_url)

        assert path == "/search"
        assert query == "q=54321&format=xml&key=None"
Beispiel #2
0
    def test_get_search_url(self):
        defaults = Defaults('http://FAKE.GLTD')

        api_url = defaults.get_search_url(54321, 'http://FAKE.GLTD/FAKER?isbn=%s&key=%s')
        _, _, path, query, _ = urlsplit(api_url)
        params = parse_qs(query)

        assert params['isbn'][0] == '54321'
        assert params['key'][0] == 'None'