aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-04-22 20:22:47 -0400
committerLibravatarUnit 193 <unit193@unit193.net>2021-04-22 20:22:47 -0400
commit8eeed31eb2f86ac982fa4b26f93b15828289c56d (patch)
tree2d95f6a10afaeb9f5e25dabde5fe38de3f8458d1 /tests
parent3a0d66f07b112b6d2bdc2b57bbf717a89a351ce6 (diff)
New upstream version 8.1.3.upstream/8.1.3
Diffstat (limited to 'tests')
-rw-r--r--tests/test_plugins.py4
-rw-r--r--tests/test_utils.py30
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()