def test_many_authors(self, mock_request): client = GoodreadsClient("GOODREADS_KEY", "GOODREADS_SECRET") # Goodreads Book data - Practical Data Science with R as of 2019-04-05. Lightly modified for testing purposes. with open("tests/unit/fixtures/book_multiple_authors.json") as f: book_response = f.read() mock_request.return_value = json.loads(book_response) book = client.book(18774683) assert len(book.authors) == 2 assert isinstance(book.authors[0], GoodreadsAuthor)
def test_book(self, mock_request): client = GoodreadsClient("GOODREADS_KEY", "GOODREADS_SECRET") with open("tests/unit/fixtures/book.json") as f: book_response = f.read() mock_request.return_value = json.loads(book_response) return client.book(39721925)