From ffb671c61a24a9086343b54bad080e145ff33fc5 Mon Sep 17 00:00:00 2001 From: Dererk Date: Tue, 15 Nov 2016 14:18:46 -0300 Subject: New upstream version 7.8.1 --- tests/test_command_import_wordpress.py | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'tests/test_command_import_wordpress.py') diff --git a/tests/test_command_import_wordpress.py b/tests/test_command_import_wordpress.py index d424162..c05188f 100644 --- a/tests/test_command_import_wordpress.py +++ b/tests/test_command_import_wordpress.py @@ -15,6 +15,7 @@ class BasicCommandImportWordpress(BaseTestCase): def setUp(self): self.module = nikola.plugins.command.import_wordpress self.import_command = self.module.CommandImportWordpress() + self.import_command.onefile = False self.import_filename = os.path.abspath(os.path.join( os.path.dirname(__file__), 'wordpress_export_example.xml')) @@ -170,6 +171,8 @@ class CommandImportWordpressTest(BasicCommandImportWordpress): def test_populate_context(self): channel = self.import_command.get_channel_from_file( self.import_filename) + self.import_command.html2text = False + self.import_command.transform_to_markdown = False self.import_command.transform_to_html = False self.import_command.use_wordpress_compiler = False context = self.import_command.populate_context(channel) @@ -194,6 +197,8 @@ class CommandImportWordpressTest(BasicCommandImportWordpress): self.import_command.no_downloads = False self.import_command.export_categories_as_categories = False self.import_command.export_comments = False + self.import_command.html2text = False + self.import_command.transform_to_markdown = False self.import_command.transform_to_html = False self.import_command.use_wordpress_compiler = False self.import_command.tag_saniziting_strategy = 'first' @@ -206,6 +211,7 @@ class CommandImportWordpressTest(BasicCommandImportWordpress): write_metadata = mock.MagicMock() write_content = mock.MagicMock() + write_post = mock.MagicMock() write_attachments_info = mock.MagicMock() download_mock = mock.MagicMock() @@ -224,7 +230,7 @@ class CommandImportWordpressTest(BasicCommandImportWordpress): self.assertTrue(write_metadata.called) write_metadata.assert_any_call( - 'new_site/stories/kontakt.meta'.replace('/', os.sep), 'Kontakt', + 'new_site/pages/kontakt.meta'.replace('/', os.sep), 'Kontakt', 'kontakt', '2009-07-16 20:20:32', '', [], **{'wp-status': 'publish'}) self.assertTrue(write_content.called) @@ -238,51 +244,39 @@ Some source code. ```Python import sys - print sys.version ``` The end. - """, True) self.assertTrue(write_attachments_info.called) write_attachments_info.assert_any_call('new_site/posts/2008/07/arzt-und-pfusch-s-i-c-k.attachments.json'.replace('/', os.sep), {10: {'wordpress_user_name': 'Niko', 'files_meta': [{'width': 300, 'height': 299}, - {'width': b'150', 'size': 'thumbnail', 'height': b'150'}], + {'width': 150, 'size': 'thumbnail', 'height': 150}], 'excerpt': 'Arzt+Pfusch - S.I.C.K.', 'date_utc': '2009-07-16 19:40:37', 'content': 'Das Cover von Arzt+Pfusch - S.I.C.K.', 'files': ['/wp-content/uploads/2008/07/arzt_und_pfusch-sick-cover.png', '/wp-content/uploads/2008/07/arzt_und_pfusch-sick-cover-150x150.png'], - 'title': 'Arzt+Pfusch - S.I.C.K.'}}) + 'title': 'Arzt+Pfusch - S.I.C.K.'}}) write_content.assert_any_call( 'new_site/posts/2008/07/arzt-und-pfusch-s-i-c-k.md'.replace('/', os.sep), '''Arzt+Pfusch - S.I.C.K.Arzt+Pfusch - S.I.C.K.Gerade bin ich \xfcber das Album S.I.C.K von Arzt+Pfusch gestolpert, welches Arzt+Pfusch zum Download f\xfcr lau anbieten. Das Album steht unter einer Creative Commons BY-NC-ND-Lizenz. - Die Ladung noisebmstupidevildustrial gibts als MP3s mit 64kbps und VBR, als Ogg Vorbis und als FLAC (letztere hier). Artwork und Lyrics gibts nochmal einzeln zum Download.''', True) write_content.assert_any_call( - 'new_site/stories/kontakt.md'.replace('/', os.sep), """

Datenschutz

- + 'new_site/pages/kontakt.md'.replace('/', os.sep), """

Datenschutz

Ich erhebe und speichere automatisch in meine Server Log Files Informationen, die dein Browser an mich \xfcbermittelt. Dies sind: - - Diese Daten sind f\xfcr mich nicht bestimmten Personen zuordenbar. Eine Zusammenf\xfchrung dieser Daten mit anderen Datenquellen wird nicht vorgenommen, die Daten werden einzig zu statistischen Zwecken erhoben.""", True) self.assertTrue(len(self.import_command.url_map) > 0) @@ -296,7 +290,7 @@ Diese Daten sind f\xfcr mich nicht bestimmten Personen zuordenbar. Eine Zusammen 'http://some.blog/posts/2008/07/arzt-und-pfusch-s-i-c-k.html') self.assertEqual( self.import_command.url_map['http://some.blog/kontakt/'], - 'http://some.blog/stories/kontakt.html') + 'http://some.blog/pages/kontakt.html') image_thumbnails = [ 'http://some.blog/wp-content/uploads/2012/12/2012-12-19-1355925145_1024x600_scrot-64x64.png', @@ -325,6 +319,8 @@ Diese Daten sind f\xfcr mich nicht bestimmten Personen zuordenbar. Eine Zusammen transform_caption = mock.MagicMock() transform_newlines = mock.MagicMock() + self.import_command.html2text = False + self.import_command.transform_to_markdown = False self.import_command.transform_to_html = False self.import_command.use_wordpress_compiler = False -- cgit v1.2.3