def test_valid_book_object_empty(self): invalid_object = {} valid = valid_book_object(invalid_object) self.assertTrue(not valid, 'Book object should be invalid')
def test_valid_book_object_missing_price(self): invalid_object = {'name': 'A', 'isbn': 12345} valid = valid_book_object(invalid_object) self.assertTrue(not valid, 'Book object should be invalid')
def test_valid_book_object_valid(self): valid_object = {'name': 'A', 'price': 2.75, 'isbn': 12345} valid = valid_book_object(valid_object) self.assertTrue(valid, 'Book object should be valid')
def test_empty_object(): assert valid_book_object(empty_object) == False
def test_missing_price(): assert valid_book_object(missing_price) == False
def test_missing_name(): assert valid_book_object(missing_name) == False
def test_valid_object(): assert valid_book_object(valid_object) == True