Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
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 = "")
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
 def __init__(self):
     self.__url = 'https://www.goodreads.com'
     security = NoneSecurity()
     self.rest = REST(security)
Ejemplo n.º 5
0
 def __init__(self):
     self.__url = 'https://openlibrary.org'
     security = NoneSecurity()
     self.rest = REST(security)
Ejemplo n.º 6
0
 def test_constructor(self):
     security = NoneSecurity()
     rest = REST(security)
     self.assertTrue(isinstance(rest, APIClient))