def test_sendDelete(self): url = 'https://w3schools.com/python/demopage.asp' command = "" security = NoneSecurity() rest = REST(security) response = rest.sendDelete(url, command) self.assertTrue(response.status_code, 400)
class OpenLibrary(object): def __init__(self): self.__url = 'https://openlibrary.org' security = NoneSecurity() self.rest = REST(security) def searchBookByTitle(self, queryText: str, page: int): url = self.__url + "/search.json?title=" + queryText + "&page=" + str(page) return self.rest.sendGet(urlCommand = url, command = "") def searchBookByAuthor(self, queryText: str, page: int): url = self.__url + "/search.json?author=" + queryText + "&page=" + str(page) return self.rest.sendGet(urlCommand = url, command = "")
class GoodReads(object): def __init__(self): self.__url = 'https://www.goodreads.com' security = NoneSecurity() self.rest = REST(security) def searchBook(self, queryText: str): command = "search: " + queryText url = self.__url + "/search/index.xml" return self.rest.sendGet(urlCommand=url, command=command)
def __init__(self): self.__url = 'https://www.goodreads.com' security = NoneSecurity() self.rest = REST(security)
def __init__(self): self.__url = 'https://openlibrary.org' security = NoneSecurity() self.rest = REST(security)
def test_constructor(self): security = NoneSecurity() rest = REST(security) self.assertTrue(isinstance(rest, APIClient))