Exemplo n.º 1
0
 def test_load_about_not_existing(self):
     # given
     content_provider = ContentProvider("wrong_path")
     content_provider.load_file = Mock()
     content_provider.load_file.return_value = None
     # then
     with self.assertRaises(ContentNotFoundException):
         content_provider.load_about()
Exemplo n.º 2
0
    def test_load_about_existing(self):
        # given
        content_provider = ContentProvider("")
        content_provider.load_file = Mock()
        content_provider.load_file.return_value = "<p>Here is some content</p>"
        # when
        content_about = content_provider.load_about()

        # then
        self.assertEqual(str(content_about), '<p>Here is some content</p>')