def test_input(self): print('test input') list = [] gc = GoogleCalendar() gcdb = GoogleCloudDb() utility = Utility(gcdb, None) book = Book(1, 'title', 'author', '12/09/99') list.append(book) utility.add_cur_results(list) bcs = BorrowConsoleState(utility, gc) self.assertEqual(bcs.input().book_id, 1)
def test_handle_input(self): print('test handle input') list = [] gc = GoogleCalendar() gcdb = GoogleCloudDb() utility = Utility(gcdb, None) book = Book(1, 'title', 'author', '12/09/99') list.append(book) utility.add_cur_results(list) utility.user = MasterUser('username', 'firstname', 'lastname', 1) bcs = BorrowConsoleState(utility, gc) bcs.handle_input(book, utility)
def test_display(self): print('test you must search first display') gc = GoogleCalendar() gcdb = GoogleCloudDb() utility = Utility(gcdb, None) bcs = BorrowConsoleState(utility, gc) bcs.display() # Test mocks a prior search result to test the display response print('testing with search first display') list = [] book = Book(1, 'title', 'author', '12/09/99') list.append(book) utility.add_cur_results(list) bcs2 = BorrowConsoleState(utility, gc) bcs2.display()