Skip to content

Commit

Permalink
Add error test case
Browse files Browse the repository at this point in the history
  • Loading branch information
blueswen committed Apr 25, 2023
1 parent d6ccc05 commit 7d1d941
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/fixtures/error_docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<img data-title="example" />
10 changes: 10 additions & 0 deletions tests/fixtures/mkdocs-error.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
site_name: test mkdocs_glightbox
use_directory_urls: true
docs_dir: error_docs

# markdown_extensions:
# - attr_list
# - md_in_html

plugins:
- glightbox
16 changes: 16 additions & 0 deletions tests/test_builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,3 +593,19 @@ def test_image_without_ext(tmp_path):
r'<a class="glightbox".*?href="https://picsum\.photos/1200/800".*?data-type="image".*?><img.*?src="https://picsum\.photos/1200/800".*?\/><\/a>',
contents,
)


def test_error(tmp_path):
"""
Wrapping for error
"""
mkdocs_file = "mkdocs-error.yml"
testproject_path = validate_mkdocs_file(
tmp_path,
f"tests/fixtures/{mkdocs_file}",
docs_path="tests/fixtures/error_docs",
)
file = testproject_path / "site/index.html"
contents = file.read_text(encoding="utf8")
validate_static(contents)
validate_script(contents)

0 comments on commit 7d1d941

Please sign in to comment.