diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_plugins.py | 4 | ||||
| -rw-r--r-- | tests/test_utils.py | 30 |
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 6760ad5..bf20a6c 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -14,3 +14,7 @@ def test_command_version(): def test_importing_plugin_task_galleries(): import nikola.plugins.task.galleries # NOQA + + +def test_importing_plugin_compile_pandoc(): + import nikola.plugins.compile.pandoc # NOQA diff --git a/tests/test_utils.py b/tests/test_utils.py index 997d520..1996679 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -20,6 +20,7 @@ from nikola.utils import ( get_theme_chain, get_translation_candidate, write_metadata, + bool_from_meta, ) @@ -573,6 +574,35 @@ def test_write_metadata_fallbacks(post, arg): assert write_metadata(data, arg) == ".. title: xx\n\n" +@pytest.mark.parametrize("value, expected", [ + ("true", True), + ("True", True), + ("TRUE", True), + ("yes", True), + ("Yes", True), + ("YES", True), + ("false", False), + ("False", False), + ("FALSE", False), + ("no", False), + ("No", False), + ("NO", False), + ("1", True), + (1, True), + ("0", False), + (0, False), + ("0", False), + (True, True), + (False, False), + ("unknown", "F"), + (None, "B"), + ("", "B"), +]) +def test_bool_from_meta(value, expected): + meta = {"key": value} + assert bool_from_meta(meta, "key", "F", "B") == expected + + @pytest.fixture def post(): return FakePost() |
