コード例 #1
0
ファイル: test_index.py プロジェクト: lotrien/holocron
    def setUp(self):
        """
        Creates generator object and number of posts which will be further used
        in test sets.
        """
        self.app = Holocron(
            conf={
                'sitename': 'MyTestSite',
                'siteurl': 'www.mytest.com',
                'author': 'Tester',
                'encoding': {
                    'output': 'my-enc',
                },
                'paths': {
                    'output': 'path/to/output',
                },
                'ext': {
                    'enabled': [],
                },
            })
        self.index = Index(self.app)

        self.open_fn = 'holocron.ext.index.open'

        self.date_early = datetime(2012, 2, 2)
        self.date_late = datetime(2014, 6, 12)
        self.date_moderate = datetime(2013, 4, 1)

        self.post_early = mock.Mock(
            spec=Post,
            published=self.date_early,
            url='www.post_early.com',
        )

        self.post_moderate = mock.Mock(spec=Post,
                                       published=self.date_moderate,
                                       url='www.post_moderate.com')

        self.post_late = mock.Mock(spec=Post,
                                   published=self.date_late,
                                   url='www.post_late.com')

        self.page = mock.Mock(spec=Page)
        self.static = mock.Mock(spec=Static)