예제 #1
0
 def test_set_all_paths(self):
     test_pelican = PelicanJson(self.item)
     for path in test_pelican.paths():
         set_nested_value(self.item, path, "NEWVALUE")
     for path in test_pelican.paths():
         value = get_nested_value(self.item, path)
         self.assertEqual(value, "NEWVALUE")
 def test_paths(self):
     test_book = PelicanJson(self.book)
     book_paths = [['ISBN:9780804720687', 'thumbnail_url'],
                   ['ISBN:9780804720687', 'bib_key'],
                   ['ISBN:9780804720687', 'preview_url'],
                   ['ISBN:9780804720687', 'info_url'],
                   ['ISBN:9780804720687', 'preview']]
     for item in test_book.paths():
         self.assertIn(item, book_paths)