From b0b24795b24ee6809397fbbadf42f31f310a219f Mon Sep 17 00:00:00 2001 From: Agustin Henze Date: Wed, 8 Jul 2015 07:35:02 -0300 Subject: Imported Upstream version 7.6.0 --- tests/test_command_import_wordpress.py | 52 +++++++++++----------------------- 1 file changed, 17 insertions(+), 35 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 fafb10c..2c47bc3 100644 --- a/tests/test_command_import_wordpress.py +++ b/tests/test_command_import_wordpress.py @@ -25,29 +25,6 @@ class BasicCommandImportWordpress(BaseTestCase): del self.import_filename -class TestXMLGlueing(BasicCommandImportWordpress): - def test_making_correct_newlines(self): - xml = [b"Some information about how to (un)subscripe to a google group with a normal mail client.\n", - b"\n", - b"Easy.\n"] - - expected_xml = b"""Some information about how to (un)subscripe to a google group with a normal mail client. - - - -Easy. -""" - self.assertEqual(expected_xml, self.import_command._glue_xml_lines(xml)) - - class TestQTranslateContentSeparation(BasicCommandImportWordpress): def test_conserves_qtranslate_less_post(self): @@ -241,7 +218,7 @@ class CommandImportWordpressTest(BasicCommandImportWordpress): self.assertTrue(write_metadata.called) write_metadata.assert_any_call( 'new_site/stories/kontakt.meta'.replace('/', os.sep), 'Kontakt', - 'kontakt', '2009-07-16 20:20:32', None, []) + 'kontakt', '2009-07-16 20:20:32', '', []) self.assertTrue(write_content.called) write_content.assert_any_call('new_site/posts/2007/04/hoert.wp'.replace('/', os.sep), @@ -251,13 +228,13 @@ class CommandImportWordpressTest(BasicCommandImportWordpress): Some source code. -~~~~~~~~~~~~{.Python} +```Python import sys print sys.version -~~~~~~~~~~~~ +``` The end. @@ -266,17 +243,25 @@ The end. write_content.assert_any_call( 'new_site/posts/2008/07/arzt-und-pfusch-s-i-c-k.wp'.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.''') write_content.assert_any_call( 'new_site/stories/kontakt.wp'.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.""") @@ -317,16 +302,16 @@ Diese Daten sind f\xfcr mich nicht bestimmten Personen zuordenbar. Eine Zusammen def test_transforming_content(self): """Applying markup conversions to content.""" - transform_sourcecode = mock.MagicMock() + transform_code = mock.MagicMock() transform_caption = mock.MagicMock() transform_newlines = mock.MagicMock() - with mock.patch('nikola.plugins.command.import_wordpress.CommandImportWordpress.transform_sourcecode', transform_sourcecode): + with mock.patch('nikola.plugins.command.import_wordpress.CommandImportWordpress.transform_code', transform_code): with mock.patch('nikola.plugins.command.import_wordpress.CommandImportWordpress.transform_caption', transform_caption): with mock.patch('nikola.plugins.command.import_wordpress.CommandImportWordpress.transform_multiple_newlines', transform_newlines): self.import_command.transform_content("random content") - self.assertTrue(transform_sourcecode.called) + self.assertTrue(transform_code.called) self.assertTrue(transform_caption.called) self.assertTrue(transform_newlines.called) @@ -340,21 +325,18 @@ import sys print sys.version [/sourcecode]""" - content = self.import_command.transform_sourcecode(content) + content = self.import_command.transform_code(content) self.assertFalse('[/sourcecode]' in content) self.assertFalse('[sourcecode language=' in content) replaced_content = """Hello World. - -~~~~~~~~~~~~{.Python} +```Python import sys print sys.version -~~~~~~~~~~~~ -""" - +```""" self.assertEqual(content, replaced_content) def test_transform_caption(self): -- cgit v1.2.3