예제 #1
0
    def test_get_books_for_author_with_empty_list(self):
        book = 'Some book'
        authors = ['Some Author']

        response, err = inventory.insert(book=book, authors=authors)

        assert response

        books = inventory.get_books_for_author(author='Random Author')

        assert len(books) == 0
예제 #2
0
    def test_get_books_for_author_with_empty_list(self):
        book = "Some book"
        authors = ["Some Author"]

        response, err = inventory.insert(book=book, authors=authors)

        assert response

        books = inventory.get_books_for_author(author="Random Author")

        assert len(books) == 0
예제 #3
0
    def test_get_books_for_author_with_books(self):
        book = 'Some book'
        authors = ['Some Author']

        response, err = inventory.insert(book=book, authors=authors)

        assert response

        books = inventory.get_books_for_author(author=authors[0])

        assert len(books) > 0
        assert books[0] == book.lower().strip()
예제 #4
0
    def test_get_books_for_author_with_books(self):
        book = "Some book"
        authors = ["Some Author"]

        response, err = inventory.insert(book=book, authors=authors)

        assert response

        books = inventory.get_books_for_author(author=authors[0])

        assert len(books) > 0
        assert books[0] == book.lower().strip()