Exemplo n.º 1
0
    def test_mandatory_properties(self):
        # If the title is not set, must throw an exception.
        page = Page('content')
        with self.assertRaises(NameError):
            page.check_properties()

        page = Page('content', metadata={'title': 'foobar'})
        page.check_properties()
Exemplo n.º 2
0
    def test_mandatory_properties(self):
        # if the title is not set, must throw an exception
        page = Page("content")
        with self.assertRaises(NameError) as cm:
            page.check_properties()

        page = Page("content", metadata={"title": "foobar"})
        page.check_properties()
Exemplo n.º 3
0
 def test_mandatory_properties(self):
     """If the title is not set, must throw an exception."""
     self.assertRaises(AttributeError, Page, 'content')
     page = Page(**self.page_kwargs)
     page.check_properties()
Exemplo n.º 4
0
 def test_mandatory_properties(self):
     """If the title is not set, must throw an exception."""
     self.assertRaises(AttributeError, Page, 'content')
     page = Page(**self.page_kwargs)
     page.check_properties()