Skip to content

Commit

Permalink
fix rest extension tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ralsina committed Aug 24, 2015
1 parent 63ac9a4 commit 49a1760
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
3 changes: 3 additions & 0 deletions tests/test_book_figure.py
Expand Up @@ -11,6 +11,9 @@


class TestBookFigure(ReSTExtensionTestCase):

extra_plugins_dirs = ["v6/book_figure/"]

@staticmethod
def setUpClass():
LOGGER.notice('--- TESTS FOR book_figure')
Expand Down
3 changes: 3 additions & 0 deletions tests/test_link_figure.py
Expand Up @@ -11,6 +11,9 @@


class TestLinkFigure(ReSTExtensionTestCase):

extra_plugins_dirs = ["v6/link_figure/"]

@staticmethod
def setUpClass():
LOGGER.notice('--- TESTS FOR link_figure')
Expand Down
2 changes: 2 additions & 0 deletions tests/test_microdata.py
Expand Up @@ -13,6 +13,8 @@

class ItemPropTestCase(ReSTExtensionTestCase):

extra_plugins_dirs = ["v6/microdata/"]

@staticmethod
def setUpClass():
LOGGER.notice('--- TESTS FOR ItemProp')
Expand Down
16 changes: 13 additions & 3 deletions tests/test_rst_compiler.py
Expand Up @@ -28,7 +28,7 @@
from __future__ import unicode_literals, absolute_import

import os

import sys

import io
try:
Expand All @@ -42,6 +42,7 @@
import pytest
import unittest

from nikola.nikola import Nikola
import nikola.plugins.compile.rest
from nikola.plugins.compile.rest import gist
from nikola.plugins.compile.rest import vimeo
Expand All @@ -50,16 +51,25 @@
from nikola.utils import _reload
from .base import BaseTestCase, FakeSite

if sys.version_info[0] == 3:
import importlib.machinery
else:
import imp

class ReSTExtensionTestCase(BaseTestCase):
""" Base class for testing ReST extensions """

sample = 'foo'
deps = None
extra_plugins_dirs = None

def setUp(self):
self.compiler = nikola.plugins.compile.rest.CompileRest()
self.compiler.set_site(FakeSite())
conf ={}
if self.extra_plugins_dirs is not None:
conf['EXTRA_PLUGINS_DIRS'] = self.extra_plugins_dirs
self.site = Nikola(**conf)
self.site.init_plugins()
self.compiler = self.site.compilers['rest']
return super(ReSTExtensionTestCase, self).setUp()

def basic_test(self):
Expand Down

0 comments on commit 49a1760

Please sign in to comment.