-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added a `null` test project that does nothing - Improved the `module` to test further things - Redefined the `MardkowPage.is_rendered()` method as "not (source is included in target)"
- Loading branch information
Laurent Franceschetti
committed
Sep 28, 2024
1 parent
6265d90
commit b76efef
Showing
9 changed files
with
146 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
""" | ||
This __init__.py file is indispensable for pytest to | ||
recognize its packages. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Main Page | ||
|
||
This project does not contain any Jinja2. | ||
|
||
This is to test the simplest case possible. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Second page | ||
|
||
It does nothing special either (no Jinja2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
site_name: Null test case (no Jinja2) | ||
theme: mkdocs | ||
|
||
nav: | ||
- Home: index.md | ||
- Next page: second.md | ||
|
||
plugins: | ||
- search | ||
- macros | ||
|
||
extra: | ||
greeting: Hello World! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
""" | ||
Testing the project | ||
(C) Laurent Franceschetti 2024 | ||
""" | ||
|
||
|
||
import pytest | ||
|
||
from test.fixture import DocProject | ||
|
||
CURRENT_PROJECT = 'simple' | ||
|
||
|
||
|
||
def test_pages(): | ||
PROJECT = DocProject(CURRENT_PROJECT) | ||
build_result = PROJECT.build(strict=False) | ||
# did not fail | ||
return_code = PROJECT.build_result.returncode | ||
assert not return_code, "Failed when it should not" | ||
|
||
|
||
# ---------------- | ||
# First page | ||
# ---------------- | ||
|
||
|
||
page = PROJECT.get_page('index') | ||
assert not page.is_rendered | ||
assert not page.has_error | ||
|
||
|
||
|
||
# ---------------- | ||
# Second page | ||
# ---------------- | ||
# there is intentionally an error (`foo` does not exist) | ||
page = PROJECT.get_page('second') | ||
|
||
assert not page.is_rendered | ||
assert not page.has_error | ||
|
||
def test_strict(): | ||
"This project must fail" | ||
PROJECT = DocProject(CURRENT_PROJECT) | ||
|
||
# it must not fail with the --strict option, | ||
PROJECT.build(strict=True) | ||
assert not PROJECT.build_result.returncode, "Failed when it should not" | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters