コード例 #1
0
ファイル: test_rss.py プロジェクト: lakhman/tinkerer
 def test_same_posts_and_max(self, make_feed_context):
     self.app.config.rss_max_items = len(self.app.builder.env.blog_posts)
     # Call the mocked function for creating the feed context and
     # verify the number of items it contains.
     list(rss.generate_feed(self.app))
     make_feed_context.assert_called_once_with(
         self.app,
         None,
         self.app.builder.env.blog_posts,
     )
コード例 #2
0
ファイル: test_rss.py プロジェクト: kiith-sa/tinkerer
 def test_same_posts_and_max(self, make_feed_context):
     self.app.config.rss_max_items = len(self.app.builder.env.blog_posts)
     # Call the mocked function for creating the feed context and
     # verify the number of items it contains.
     list(rss.generate_feed(self.app))
     make_feed_context.assert_called_once_with(
         self.app,
         None,
         self.app.builder.env.blog_posts,
     )
コード例 #3
0
ファイル: blog.py プロジェクト: scudette/tinkerer
def collect_additional_pages(app):
    '''
    Generates additional pages.
    '''
    for name, context, template in rss.generate_feed(app):
        yield (name, context, template)

    for name, context, template in filing.make_tag_pages(app):
        yield (name, context, template)

    for name, context, template in filing.make_category_pages(app):
        yield (name, context, template)

    for name, context, template in aggregator.make_aggregated_pages(app):
        yield (name, context, template)

    for name, context, template in filing.make_archive(app):
        yield (name, context, template)
コード例 #4
0
ファイル: blog.py プロジェクト: takekazuomi/tinkerer
def collect_additional_pages(app):
    '''
    Generates additional pages.
    '''
    for name, context, template in rss.generate_feed(app):
        yield (name, context, template)

    for name, context, template in filing.make_tag_pages(app):
        yield (name, context, template)

    for name, context, template in filing.make_category_pages(app):
        yield (name, context, template)

    for name, context, template in aggregator.make_aggregated_pages(app):
        yield (name, context, template)

    for name, context, template in filing.make_archive(app):
        yield (name, context, template)
コード例 #5
0
ファイル: test_rss.py プロジェクト: lakhman/tinkerer
 def test_no_posts(self, make_feed_context):
     make_feed_context.side_effect = AssertionError('should not be called')
     self.app.builder.env.blog_posts = []
     list(rss.generate_feed(self.app))
コード例 #6
0
ファイル: test_rss.py プロジェクト: kiith-sa/tinkerer
 def test_no_posts(self, make_feed_context):
     make_feed_context.side_effect = AssertionError('should not be called')
     self.app.builder.env.blog_posts = []
     list(rss.generate_feed(self.app))