diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_command_import_wordpress.py | 1 | ||||
| -rw-r--r-- | tests/test_compile_markdown.py | 7 | ||||
| -rw-r--r-- | tests/test_integration.py | 16 | ||||
| -rw-r--r-- | tests/test_locale.py | 2 |
4 files changed, 13 insertions, 13 deletions
diff --git a/tests/test_command_import_wordpress.py b/tests/test_command_import_wordpress.py index c1c7836..d424162 100644 --- a/tests/test_command_import_wordpress.py +++ b/tests/test_command_import_wordpress.py @@ -196,6 +196,7 @@ class CommandImportWordpressTest(BasicCommandImportWordpress): self.import_command.export_comments = False self.import_command.transform_to_html = False self.import_command.use_wordpress_compiler = False + self.import_command.tag_saniziting_strategy = 'first' self.import_command.context = self.import_command.populate_context( channel) diff --git a/tests/test_compile_markdown.py b/tests/test_compile_markdown.py index 47cbdbb..2275b04 100644 --- a/tests/test_compile_markdown.py +++ b/tests/test_compile_markdown.py @@ -61,6 +61,13 @@ class CompileMarkdownTests(BaseTestCase): actual_output = self.compile(input_str) self.assertEquals(actual_output.strip(), expected_output.strip()) + def test_compile_strikethrough(self): + input_str = '~~strik text~~' + expected_output = '<p><del>strik text</del></p>' + + actual_output = self.compile(input_str) + self.assertEquals(actual_output.strip(), expected_output.strip()) + def test_compile_html_gist(self): input_str = '''\ Here's a gist file inline: diff --git a/tests/test_integration.py b/tests/test_integration.py index 4bfd1d2..352aab6 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -307,18 +307,11 @@ class TestCheck(DemoBuildTest): def test_check_links(self): with cd(self.target_dir): - try: - __main__.main(['check', '-l']) - except SystemExit as e: - self.assertEqual(e.code, 0) + self.assertIsNone(__main__.main(['check', '-l'])) def test_check_files(self): with cd(self.target_dir): - try: - __main__.main(['check', '-f']) - except SystemExit as e: - self.assertEqual(e.code, 0) - + self.assertIsNone(__main__.main(['check', '-f'])) class TestCheckAbsoluteSubFolder(TestCheck): """Validate links in a site which is: @@ -532,12 +525,11 @@ class InvariantBuildTest(EmptyBuildTest): src1 = os.path.join(os.path.dirname(__file__), 'data', '1-nolinks.rst') dst1 = os.path.join(self.target_dir, 'posts', '1.rst') shutil.copy(src1, dst1) - os.system('rm "{0}/stories/creating-a-theme.rst" "{0}/stories/extending.txt" "{0}/stories/internals.txt" "{0}/stories/manual.rst" "{0}/stories/social_buttons.txt" "{0}/stories/theming.rst" "{0}/stories/upgrading-to-v6.txt"'.format(self.target_dir)) - + os.system('rm "{0}/stories/creating-a-theme.rst" "{0}/stories/extending.txt" "{0}/stories/internals.txt" "{0}/stories/manual.rst" "{0}/stories/social_buttons.txt" "{0}/stories/theming.rst" "{0}/stories/path_handlers.txt" "{0}/stories/charts.txt"'.format(self.target_dir)) def test_invariance(self): """Compare the output to the canonical output.""" if sys.version_info[0:2] != (2, 7): - pytest.skip('only python 2.7 is supported right now') + pytest.skip('only python 2.7 is supported for invariance') good_path = os.path.join(os.path.dirname(__file__), 'data', 'baseline{0[0]}.{0[1]}'.format(sys.version_info)) if not os.path.exists(good_path): pytest.skip('no baseline found') diff --git a/tests/test_locale.py b/tests/test_locale.py index d24fdfb..8ffa112 100644 --- a/tests/test_locale.py +++ b/tests/test_locale.py @@ -214,8 +214,8 @@ class TestLocaleBorg(unittest.TestCase): def test_services_reject_dumb_wrong_call(self): lang_11, loc_11 = LocaleSupportInTesting.langlocales['default'] nikola.utils.LocaleBorg.reset() + self.assertRaises(Exception, nikola.utils.LocaleBorg) self.assertRaises(Exception, nikola.utils.LocaleBorg.set_locale, lang_11) - self.assertRaises(Exception, getattr, nikola.utils.LocaleBorg, 'current_lang') def test_set_locale_raises_on_invalid_lang(self): lang_11, loc_11 = LocaleSupportInTesting.langlocales['default'] |
