Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ test = [
"jsonfeed-util>=1.2,<2",
"mkdocs-material[imaging]>=9.7,<9.8",
"mkdocs-materialx[imaging]>=10.1.3,<11",
"properdocs>=1.6.7,<2",
"properdocs-theme-mkdocs>=1.6.5,<2",
"properdocs-theme-readthedocs>=1.6.5,<2",
"pytest-cov>=6.9.1,<8",
"validator-collection>=1.5,<1.6",
]
Expand Down
3 changes: 3 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# redirect every mkdocs.* import to properdocs.* before any test module (or the
# plugin itself) imports MkDocs, so that only ProperDocs classes are used.
import properdocs.replacement # noqa: F401
18 changes: 9 additions & 9 deletions tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
# 3rd party
from click.testing import CliRunner

# MkDocs
from mkdocs.__main__ import build_command
from mkdocs.config import load_config
from mkdocs.config.base import Config
# ProperDocs
from properdocs.__main__ import build_command
from properdocs.config import load_config
from properdocs.config.base import Config

# package
from mkdocs_rss_plugin.plugin import GitRssPlugin
Expand Down Expand Up @@ -78,7 +78,7 @@ def build_docs_setup(
output_path: Path,
strict: bool = True,
):
"""Runs the `mkdocs build` command.
"""Runs the `properdocs build` command.

:param testproject_path: Path to test project
:type testproject_path: Path
Expand Down Expand Up @@ -138,7 +138,7 @@ def setup_clean_mkdocs_folder(

# Copy correct mkdocs.yml file and our test 'docs/'
shutil.copytree("tests/fixtures/docs", testproject_path / "docs")
shutil.copyfile(mkdocs_yml_filepath, testproject_path / "mkdocs.yml")
shutil.copyfile(mkdocs_yml_filepath, testproject_path / "properdocs.yml")

return testproject_path

Expand Down Expand Up @@ -174,15 +174,15 @@ def setup_clean_mkdocs_folder(
import feedparser

base = BaseTest()
plg_cfg = base.get_plugin_config_from_mkdocs(Path("mkdocs.yml"), "rss")
plg_cfg = base.get_plugin_config_from_mkdocs(Path("properdocs.yml"), "rss")
print(type(plg_cfg))
# truc = base.setup_clean_mkdocs_folder(
# mkdocs_yml_filepath=Path("mkdocs.yml"), output_path=Path("tests/fixtures/")
# mkdocs_yml_filepath=Path("properdocs.yml"), output_path=Path("tests/fixtures/")
# )
# print(truc)
run_result = base.build_docs_setup(
testproject_path="docs",
mkdocs_yml_filepath=Path("mkdocs.yml"),
mkdocs_yml_filepath=Path("properdocs.yml"),
output_path=Path("zoubi"),
)
print(type(run_result), run_result.exit_code)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from pathlib import Path

# 3rd party
from mkdocs.config.base import Config
from properdocs.config.base import Config

from mkdocs_rss_plugin.config import RssPluginConfig

Expand Down
2 changes: 1 addition & 1 deletion tests/test_integrations_material.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from pathlib import Path

# 3rd party
from mkdocs.config import load_config
from properdocs.config import load_config

# package
from mkdocs_rss_plugin.integrations.theme_material_base import (
Expand Down
2 changes: 1 addition & 1 deletion tests/test_integrations_material_blog.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# 3rd party
import feedparser
from mkdocs.config import load_config
from properdocs.config import load_config

# package
from mkdocs_rss_plugin.integrations.theme_material_blog_plugin import (
Expand Down
2 changes: 1 addition & 1 deletion tests/test_integrations_material_social_cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# 3rd party
import feedparser
from mkdocs.config import load_config
from properdocs.config import load_config

# package
from mkdocs_rss_plugin.__about__ import __title_clean__
Expand Down
2 changes: 1 addition & 1 deletion tests/test_rss_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def test_authors_invalid_type_logs_warning(self):
page.file.abs_src_path = "docs/page.md"
page.meta = {"authors": 42}

with self.assertLogs("mkdocs.plugins.[RSS-plugin]", "WARNING") as logs:
with self.assertLogs("properdocs.plugins.[RSS-plugin]", "WARNING") as logs:
authors = self.plg_utils.get_authors_from_meta(in_page=page)

self.assertIsNone(authors)
Expand Down
Loading