Exemple #1
0
 def test_single_book_empty_subject(self):
     book_collection_test = [{'author': 'Tzonis',
                              'title': 'Santiago Calatrava The Complete Works Expanded Edition',
                              'publisher': 'Rizzoli', 'shelf': '12',
                              'category': 'Architecture', 'subject': ''}]
     expected_output = [{'author': 'Tzonis',
                         'title': 'Santiago Calatrava The Complete Works Expanded Edition',
                         'publisher': 'Rizzoli', 'shelf': '12', 'category': 'Architecture',
                         'subject': 'None'}]
     actual_value = book_collection_empty_value_checker(book_collection_test)
     self.assertEqual(expected_output, actual_value)
Exemple #2
0
 def test_three_books_one_category_empty(self):
     book_collection_test = [{'author': 'Tzonis',
                              'title': 'Santiago Calatrava The Complete Works Expanded Edition',
                              'publisher': 'Rizzoli', 'shelf': '33',
                              'category': 'Architecture', 'subject': '20th Century'},
                             {'author': 'Ramen Noodles', 'title': 'Top Ramen',
                              'publisher': 'Nong Shim', 'shelf': 'Lego',
                              'category': 'Food', 'subject': 'Sustenance'},
                             {'author': 'Steven Jobs', 'title': 'Apple and Oranges',
                              'publisher': 'California', 'shelf': '2',
                              'category': '', 'subject': 'Biography'}]
     expected_output = [{'author': 'Tzonis',
                         'title': 'Santiago Calatrava The Complete Works Expanded Edition',
                         'publisher': 'Rizzoli', 'shelf': '33',
                         'category': 'Architecture', 'subject': '20th Century'},
                        {'author': 'Ramen Noodles', 'title': 'Top Ramen',
                         'publisher': 'Nong Shim', 'shelf': 'Lego',
                         'category': 'Food', 'subject': 'Sustenance'},
                        {'author': 'Steven Jobs', 'title': 'Apple and Oranges',
                         'publisher': 'California', 'shelf': '2',
                         'category': 'None', 'subject': 'Biography'}]
     actual_value = book_collection_empty_value_checker(book_collection_test)
     self.assertEqual(expected_output, actual_value)
Exemple #3
0
 def test_empty(self):
     book_collection_test = []
     expected_output = []
     actual_value = book_collection_empty_value_checker(book_collection_test)
     self.assertEqual(expected_output, actual_value)