mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
skip unless deps are installed in tests
This commit is contained in:
parent
98c8041df2
commit
191b1cdb0f
1 changed files with 10 additions and 1 deletions
|
|
@ -8,12 +8,20 @@ from .support import unittest, temporary_folder, mute
|
||||||
CUR_DIR = os.path.dirname(__file__)
|
CUR_DIR = os.path.dirname(__file__)
|
||||||
WORDPRESS_XML_SAMPLE = os.path.join(CUR_DIR, 'content', 'wordpressexport.xml')
|
WORDPRESS_XML_SAMPLE = os.path.join(CUR_DIR, 'content', 'wordpressexport.xml')
|
||||||
|
|
||||||
|
PANDOC = os.system('pandoc --version') == 0
|
||||||
|
try:
|
||||||
|
import BeautifulSoup
|
||||||
|
except ImportError:
|
||||||
|
BeautifulSoup = False # NOQA
|
||||||
|
|
||||||
|
|
||||||
class TestWordpressXmlImporter(unittest.TestCase):
|
class TestWordpressXmlImporter(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.posts = wp2fields(WORDPRESS_XML_SAMPLE)
|
self.posts = wp2fields(WORDPRESS_XML_SAMPLE)
|
||||||
|
|
||||||
|
@unittest.skipUnless(PANDOC and BeautifulSoup,
|
||||||
|
'Needs Pandoc and BeautifulSoup')
|
||||||
def test_ignore_empty_posts(self):
|
def test_ignore_empty_posts(self):
|
||||||
|
|
||||||
posts = list(self.posts)
|
posts = list(self.posts)
|
||||||
|
|
@ -21,7 +29,8 @@ class TestWordpressXmlImporter(unittest.TestCase):
|
||||||
for title, content, fname, date, author, categ, tags, format in posts:
|
for title, content, fname, date, author, categ, tags, format in posts:
|
||||||
self.assertTrue(title.strip())
|
self.assertTrue(title.strip())
|
||||||
|
|
||||||
@unittest.skipUnless(os.system('pandoc --version') == 0, 'pandoc is not installed')
|
@unittest.skipUnless(PANDOC and BeautifulSoup,
|
||||||
|
'Needs Pandoc and BeautifulSoup')
|
||||||
def test_can_toggle_raw_html_code_parsing(self):
|
def test_can_toggle_raw_html_code_parsing(self):
|
||||||
|
|
||||||
posts = list(self.posts)
|
posts = list(self.posts)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue