mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
import chyrp feed file
This commit is contained in:
parent
be040715f9
commit
1b906da57a
3 changed files with 42 additions and 2 deletions
1
tests/content/chyrpexport.atom
Executable file
1
tests/content/chyrpexport.atom
Executable file
File diff suppressed because one or more lines are too long
|
|
@ -2,11 +2,12 @@
|
|||
|
||||
import os
|
||||
|
||||
from pelican.tools.pelican_import import wp2fields, fields2pelican
|
||||
from pelican.tools.pelican_import import wp2fields, chyrp2fields, fields2pelican
|
||||
from .support import unittest, temporary_folder, mute, skipIfNoExecutable
|
||||
|
||||
CUR_DIR = os.path.dirname(__file__)
|
||||
WORDPRESS_XML_SAMPLE = os.path.join(CUR_DIR, 'content', 'wordpressexport.xml')
|
||||
CHYRP_ATOM_SAMPLE = os.path.join(CUR_DIR, 'content', 'chyrpexport.atom')
|
||||
|
||||
try:
|
||||
import BeautifulSoup
|
||||
|
|
@ -16,6 +17,19 @@ except ImportError:
|
|||
|
||||
@skipIfNoExecutable(['pandoc', '--version'])
|
||||
@unittest.skipUnless(BeautifulSoup, 'Needs BeautifulSoup module')
|
||||
|
||||
class TestChyrpAtomImporter(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.posts = chyrp2fields(CHYRP_ATOM_SAMPLE)
|
||||
|
||||
def test_ignore_empty_posts(self):
|
||||
|
||||
posts = list(self.posts)
|
||||
self.assertTrue(posts)
|
||||
for title, content, slug, date, author, tags, format in posts:
|
||||
self.assertTrue(title.strip())
|
||||
|
||||
class TestWordpressXmlImporter(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue