示例#1
0
 def test_add_new_book(self):
     book = "Lord of the Flies"
     patron = Patron("first", "last", 23, "98765432")
     patron.add_borrowed_book(book)
     self.assertEqual(patron.get_borrowed_books()[0],
                      "Lord of the Flies".lower())
示例#2
0
 def test_return_book(self):
     book = "Lord of the Flies"
     patron = Patron("first", "last", 23, "98765432")
     patron.add_borrowed_book(book)
     patron.return_borrowed_book(book)
     self.assertEqual(len(patron.get_borrowed_books()), 0)
示例#3
0
 def test_get_books(self):
     patron = Patron("first", "last", 23, "98765432")
     books = patron.get_borrowed_books()
     self.assertFalse(books, "Expected empty list")