Fix formatting
This commit is contained in:
@@ -36,7 +36,10 @@ class TechDocsCore(BasePlugin):
|
||||
|
||||
# Theme
|
||||
config["theme"] = Theme(
|
||||
name="material", static_templates=["techdocs_metadata.json",],
|
||||
name="material",
|
||||
static_templates=[
|
||||
"techdocs_metadata.json",
|
||||
],
|
||||
)
|
||||
config["theme"].dirs.append(tempfile.gettempdir())
|
||||
|
||||
|
||||
@@ -3,15 +3,17 @@ import mkdocs.config as config
|
||||
import mkdocs.plugins as plugins
|
||||
from .core import TechDocsCore
|
||||
|
||||
|
||||
class DummyTechDocsCorePlugin(plugins.BasePlugin):
|
||||
pass
|
||||
|
||||
|
||||
class TestTechDocsCoreConfig(unittest.TestCase):
|
||||
def setUp(self):
|
||||
self.techdocscore = TechDocsCore()
|
||||
self.plugin_collection = plugins.PluginCollection()
|
||||
plugin = DummyTechDocsCorePlugin()
|
||||
self.plugin_collection['techdocs-core'] = plugin
|
||||
self.plugin_collection["techdocs-core"] = plugin
|
||||
self.mkdocs_yaml_config = {"plugins": self.plugin_collection}
|
||||
|
||||
def test_removes_techdocs_core_plugin_from_config(self):
|
||||
@@ -24,9 +26,9 @@ class TestTechDocsCoreConfig(unittest.TestCase):
|
||||
self.mkdocs_yaml_config["markdown_extension"].append(["toc"])
|
||||
self.mkdocs_yaml_config["mdx_configs"]["toc"] = {"toc_depth": 3}
|
||||
final_config = self.techdocscore.on_config(self.mkdocs_yaml_config)
|
||||
self.assertTrue("toc" in final_config["mdx_configs"])
|
||||
self.assertTrue("permalink" in final_config["mdx_configs"]["toc"])
|
||||
self.assertTrue("toc_depth" in final_config["mdx_configs"]["toc"])
|
||||
self.assertTrue("toc" in final_config["mdx_configs"])
|
||||
self.assertTrue("permalink" in final_config["mdx_configs"]["toc"])
|
||||
self.assertTrue("toc_depth" in final_config["mdx_configs"]["toc"])
|
||||
|
||||
def test_override_default_config_with_user_config(self):
|
||||
self.mkdocs_yaml_config["markdown_extension"] = []
|
||||
@@ -34,6 +36,6 @@ class TestTechDocsCoreConfig(unittest.TestCase):
|
||||
self.mkdocs_yaml_config["markdown_extension"].append(["toc"])
|
||||
self.mkdocs_yaml_config["mdx_configs"]["toc"] = {"permalink": False}
|
||||
final_config = self.techdocscore.on_config(self.mkdocs_yaml_config)
|
||||
self.assertTrue("toc" in final_config["mdx_configs"])
|
||||
self.assertTrue("permalink" in final_config["mdx_configs"]["toc"])
|
||||
self.assertTrue("toc" in final_config["mdx_configs"])
|
||||
self.assertTrue("permalink" in final_config["mdx_configs"]["toc"])
|
||||
self.assertFalse(final_config["mdx_configs"]["toc"]["permalink"])
|
||||
|
||||
Reference in New Issue
Block a user