Exemplo n.º 1
0
 def test_mandatory_properties(self):
     # If the title is not set, must throw an exception.
     page = Page('content')
     self.assertFalse(page._has_valid_mandatory_properties())
     self.assertLogCountEqual(
             count=1,
             msg="Skipping .*: could not find information about 'title'",
             level=logging.ERROR)
     page = Page('content', metadata={'title': 'foobar'})
     self.assertTrue(page._has_valid_mandatory_properties())
Exemplo n.º 2
0
 def test_mandatory_properties(self):
     # If the title is not set, must throw an exception.
     page = Page('content')
     self.assertFalse(page._has_valid_mandatory_properties())
     self.assertLogCountEqual(
         count=1,
         msg="Skipping .*: could not find information about 'title'",
         level=logging.ERROR)
     page = Page('content', metadata={'title': 'foobar'})
     self.assertTrue(page._has_valid_mandatory_properties())
 def test_props_must_exist(self):
     page = Page('content')
     self.assertFalse(page._has_valid_mandatory_properties())
     new_page = Page('content', metadata={'title': 'Pelican'})
     self.assertTrue(new_page._has_valid_mandatory_properties())