def test_favBooks_returns_correct_list_when_no_books_read(self): #test that when bookLst = None favBooks returns empty list # Set up testName = 'Diana McSpadden' testEmail = '*****@*****.**' testGenre = 'Historical Fiction' # create initial bookLvr bookLvr1 = BOOKLOVER(testName, testEmail, testGenre) #test if favBooks returns correct list self.assertEqual(bookLvr1.favBooks(), [])
def test_favBooks_returns_correct_list(self): # test that favBooks() returns expected list # Set up testName = 'Diana McSpadden' testEmail = '*****@*****.**' testGenre = 'Historical Fiction' testBookNum = 2 testBookLst = [('Black Hills: A Novel',4),('The Red Tent',5),('The Notebook',1),('The Color Purple',5)] # create initial bookLvr bookLvr1 = BOOKLOVER(testName, testEmail, testGenre, testBookNum, testBookLst) #test if favBooks returns correct list self.assertEqual(bookLvr1.favBooks(), ['Black Hills: A Novel','The Red Tent','The Color Purple'])