Skip to content
Permalink
Browse files

Fix tests

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Aug 21, 2015
1 parent de2a602 commit 63ac9a474c996a6962f1968e803bb1434566813e
Showing with 7 additions and 11 deletions.
  1. +6 −11 tests/base.py
  2. +1 −0 tests/test_command_tags.py
@@ -9,12 +9,9 @@
__all__ = ["BaseTestCase", "cd", "LocaleSupportInTesting"]


# This code is so you can run the samples without installing the package,
# and should be before any import touching nikola, in any file under tests/
import os
import sys
extra_v6_plugin_dir = os.path.join(os.path.dirname(__file__), '..', 'v6')
sys.path.insert(0, extra_v6_plugin_dir)


from contextlib import contextmanager
import locale
@@ -204,11 +201,10 @@ def __init__(self):
self.config = {
'DISABLED_PLUGINS': [],
'EXTRA_PLUGINS': [],
'EXTRA_PLUGINS_DIRS': [extra_v6_plugin_dir],
'DEFAULT_LANG': 'en',
'MARKDOWN_EXTENSIONS': ['fenced_code', 'codehilite'],
'TRANSLATIONS_PATTERN': '{path}.{lang}.{ext}',
'LISTINGS_FOLDERS': {},
'LISTINGS_FOLDERS': {'listings': 'listings'},
}
self.EXTRA_PLUGINS = self.config['EXTRA_PLUGINS']
self.plugin_manager = PluginManager(categories_filter={
@@ -219,20 +215,19 @@ def __init__(self):
"PageCompiler": PageCompiler,
"TaskMultiplier": TaskMultiplier,
"CompilerExtension": CompilerExtension,
"RestExtension": RestExtension,
"MarkdownExtension": MarkdownExtension,
"RestExtension": RestExtension
})
self.loghandlers = [nikola.utils.STDERR_HANDLER]
self.loghandlers = nikola.utils.STDERR_HANDLER # TODO remove on v8
self.plugin_manager.setPluginInfoExtension('plugin')
extra_plugins_dirs = self.config['EXTRA_PLUGINS_DIRS']
if sys.version_info[0] == 3:
places = [
os.path.join(os.path.dirname(nikola.utils.__file__), 'plugins'),
] + [path for path in extra_plugins_dirs if path]
]
else:
places = [
os.path.join(os.path.dirname(nikola.utils.__file__), nikola.utils.sys_encode('plugins')),
] + [nikola.utils.sys_encode(path) for path in extra_plugins_dirs if path]
]
self.plugin_manager.setPluginPlaces(places)
self.plugin_manager.collectPlugins()
self.compiler_extensions = self._activate_plugins_of_category("CompilerExtension")
@@ -60,6 +60,7 @@ def _init_site(self):
sys.path.pop(0)

self._site = nikola.Nikola(**conf.__dict__)
self._site.init_plugins()

def _parse_new_tags(self, source):
""" Returns the new tags for a post, given it's source path. """

0 comments on commit 63ac9a4

Please sign in to comment.
You can’t perform that action at this time.