def test_run_auto_excerpt(self, kb_app, sphinx_app, dummy_article,
                           excerpt):
     sphinx_app.confdir = '/tmp'
     excerpt.attributes = dict(source='/tmp/article1.rst')
     sphinx_app.env.resources = dict(article1=dummy_article)
     assert None is getattr(dummy_article, 'excerpt', None)
     stamp_excerpt(kb_app, sphinx_app, excerpt)
     assert 'First paragraph.' == dummy_article.excerpt
 def test_run_without_resource(self, kb_app, sphinx_app, dummy_article,
                               excerpt):
     sphinx_app.confdir = '/tmp'
     excerpt.attributes = dict(source='/tmp/article1.rst')
     sphinx_app.env.resources = dict()
     assert None is getattr(dummy_article, 'excerpt', None)
     stamp_excerpt(kb_app, sphinx_app, excerpt)
     assert None is getattr(dummy_article, 'excerpt')
 def test_run_manual_excerpt(self, kb_app, sphinx_app, dummy_article,
                             excerpt):
     sphinx_app.confdir = '/tmp'
     excerpt.attributes = dict(source='/tmp/article1.rst')
     dummy_article.props.excerpt = 'Manual Excerpt.'
     sphinx_app.env.resources = dict(article1=dummy_article)
     assert None is getattr(dummy_article, 'excerpt', None)
     stamp_excerpt(kb_app, sphinx_app, excerpt)
     assert 'Manual Excerpt.' == dummy_article.excerpt