Skip to content
Permalink
Browse files

fix rest extension tests

  • Loading branch information
ralsina committed Aug 24, 2015
1 parent 63ac9a4 commit 49a1760c210b8fb152b2ee3ce5d2643979f068ad
Showing with 21 additions and 3 deletions.
  1. +3 −0 tests/test_book_figure.py
  2. +3 −0 tests/test_link_figure.py
  3. +2 −0 tests/test_microdata.py
  4. +13 −3 tests/test_rst_compiler.py
@@ -11,6 +11,9 @@


class TestBookFigure(ReSTExtensionTestCase):

extra_plugins_dirs = ["v6/book_figure/"]

@staticmethod
def setUpClass():
LOGGER.notice('--- TESTS FOR book_figure')
@@ -11,6 +11,9 @@


class TestLinkFigure(ReSTExtensionTestCase):

extra_plugins_dirs = ["v6/link_figure/"]

@staticmethod
def setUpClass():
LOGGER.notice('--- TESTS FOR link_figure')
@@ -13,6 +13,8 @@

class ItemPropTestCase(ReSTExtensionTestCase):

extra_plugins_dirs = ["v6/microdata/"]

@staticmethod
def setUpClass():
LOGGER.notice('--- TESTS FOR ItemProp')
@@ -28,7 +28,7 @@
from __future__ import unicode_literals, absolute_import

import os

import sys

import io
try:
@@ -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
@@ -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):

0 comments on commit 49a1760

Please sign in to comment.