Beispiel #1
0
 def testOverDue(self):
     """
     A book becomes overdue after '2 weeks?'
     I don't know how to test this.
     """
     lib     = Library()
     lib.add_books(self._book)
     
     real    = Book("book_seven",'0000111125433',"author_seven","genre_seven")
     real.method = Mock(return_value=datetime().today()+datetime.timedelta(days=14))
     print(real.method(1234,"hey You!"))
Beispiel #2
0
 def testCheckedOutTo(self):
     """
     A book should always be checked out to a customer
     or be back at the library(None)
     """
     lib   = Library()
     lib.add_books(self._book)
     self.assertIsNone(lib.books_all[0].checked_out_to)
     # when a book is checked out it should obtain status checked_out_to 
     # to point to a cus
     cus         = "Garry"
     lib.checkout(self._book,cus)
     self.assertEqual(cus,self._book.checked_out_to)