Beispiel #1
0
 def test_valid_book_object_empty(self):
     invalid_object = {}
     valid = valid_book_object(invalid_object)
     self.assertTrue(not valid, 'Book object should be invalid')
Beispiel #2
0
 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')
Beispiel #3
0
 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')
Beispiel #4
0
def test_empty_object():
    assert valid_book_object(empty_object) == False
Beispiel #5
0
def test_missing_price():
    assert valid_book_object(missing_price) == False
Beispiel #6
0
def test_missing_name():
    assert valid_book_object(missing_name) == False
Beispiel #7
0
def test_valid_object():
    assert valid_book_object(valid_object) == True