def test_show_books_list(self, mock_print): bk1 = Book('a', 'aaa') bk2 = Book('b', 'bbb') books = [bk1, bk2] ui.show_books(books) mock_print.assert_any_call(bk1) mock_print.assert_any_call(bk2)
def search_book(): # while true: search_term = ui.ask_question( 'Enter search term, will match partial authors or titles.') # if(not search_term): # print("You cannot enter in a blank string") # else: # break matches = store.book_search(search_term) ui.show_books(matches)
def search_book(): search_term = ui.ask_question( 'Enter search term, will match partial authors or titles.') if search_term == None: print('Nothing was entered try again') else: matches = store.book_search(search_term) ui.show_books(matches)
def test_show_books_empty(self, mock_print): books = [] ui.show_books(books) mock_print.assert_called_with('No books to display')
def search_book(): search_term = ui.ask_question( 'Enter search term, will match partial authors or titles.') matches = store.book_search(search_term) ui.show_books(matches)
def show_all_books(): books = store.get_all_books() ui.show_books(books)
def show_unread_books(): unread_books = store.get_books_by_read_value(False) ui.show_books(unread_books)
def show_read_books(): read_books = store.get_books_by_read_value(True) ui.show_books(read_books)
def delete_book(): search_term = ui.ask_question('Enter book ID: ' ) matches = store.book_search(search_term) ui.show_books(matches) # Corrected "show_book" to "show_books"
def search_book(): """ searches book in the database then displays it""" search_term = ui.ask_question( 'Enter search term, will match partial authors or titles.') matches = store.book_search(search_term) ui.show_books(matches)
def show_all_books(): """ gets all the books in the database then displays it""" books = store.get_all_books() ui.show_books(books)
def show_unread_books(): """ lists unread books""" unread_books = store.get_books_by_read_value(False) ui.show_books(unread_books)
def show_read_books(): """ lists books that are read""" read_books = store.get_books_by_read_value(True) ui.show_books(read_books)