Beispiel #1
0
 def test_initialize_calls_plugins(self):
     store = YawtSiteManager(root_dir=self.root_dir)
     store.initialize()
     mock_plugins = yawt.site_manager.call_plugins_arg
     mock_plugins.assert_called_with('on_new_site',
                                     ['config.py',
                                      'article.html',
                                      '404.html'])
Beispiel #2
0
    def test_initialize_sets_up_site_with_non_defaults(self):
        store = YawtSiteManager(root_dir=self.root_dir,
                                template_folder='another_templates',
                                content_folder='another_content',
                                draft_folder='another_drafts')

        store.initialize()

        assert os.path.exists(os.path.join(self.root_dir, 'another_templates'))
        assert not os.path.exists(os.path.join(self.root_dir, 'templates'))

        assert os.path.exists(os.path.join(self.root_dir, 'another_content'))
        assert not os.path.exists(os.path.join(self.root_dir, 'content'))

        assert os.path.exists(os.path.join(self.root_dir, 'another_drafts'))
        assert not os.path.exists(os.path.join(self.root_dir, 'drafts'))
Beispiel #3
0
 def test_initialize_sets_up_site_with_defaults(self):
     store = YawtSiteManager(root_dir=self.root_dir)
     store.initialize()
     assert os.path.exists(self.root_dir)
     assert os.path.exists(os.path.join(self.root_dir,
                                        store.template_folder))
     assert os.path.exists(os.path.join(self.root_dir,
                                        store.content_folder))
     assert os.path.exists(os.path.join(self.root_dir,
                                        'config.py'))
     assert os.path.exists(os.path.join(self.root_dir,
                                        store.template_folder,
                                        'article.html'))
     assert os.path.exists(os.path.join(self.root_dir,
                                        store.template_folder,
                                        '404.html'))