-
Notifications
You must be signed in to change notification settings - Fork 2
add doc:links and docs:links:check #427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
c55cef1
add doc:links and docs:links:check
Jannis-Mittenzwei aa7cf9e
add doc:links and docs:links:check
Jannis-Mittenzwei 88b4fe8
use sphinx linkcheck
Jannis-Mittenzwei a77d339
changed docs:links
Jannis-Mittenzwei 85bed99
changed docs:links
Jannis-Mittenzwei 1a6ac45
changed docs:links
Jannis-Mittenzwei 800e2d4
changed docs:links
Jannis-Mittenzwei a1989c6
Merge branch 'main' into feature/#409-Doc-link-&-checks
ArBridgeman fd521f5
changed docs:links:check
Jannis-Mittenzwei f88e0f0
Merge branch 'main' into feature/#409-Doc-link-&-checks
Jannis-Mittenzwei d0f9602
Merge branch 'feature/#409-Doc-link-&-checks' of github.com:exasol/py…
Jannis-Mittenzwei e22c6cf
add test
Jannis-Mittenzwei ec44ab2
fix
Jannis-Mittenzwei 4bb7bb0
fix
Jannis-Mittenzwei 9c666d6
new version
Jannis-Mittenzwei 1bb5bdb
Merge branch 'main' into feature/#409-Doc-link-&-checks
Jannis-Mittenzwei df63fb8
fix
Jannis-Mittenzwei 5cd3532
fix
Jannis-Mittenzwei 1ecae4c
fix
Jannis-Mittenzwei f352a07
fix
Jannis-Mittenzwei bb14ca1
fix
Jannis-Mittenzwei b1c0cb1
fix
Jannis-Mittenzwei f91ba0f
fix
Jannis-Mittenzwei 7a4c05b
add tests for doc links
Jannis-Mittenzwei 15131a4
Merge branch 'main' into feature/#409-Doc-link-&-checks
Jannis-Mittenzwei 09128c2
doc
Jannis-Mittenzwei 134e024
Merge branch 'main' into feature/#409-Doc-link-&-checks
Jannis-Mittenzwei 44cc980
Merge branch 'main' into feature/#409-Doc-link-&-checks
Jannis-Mittenzwei a017108
resolve conversation
Jannis-Mittenzwei 2969168
formatting
Jannis-Mittenzwei 48847f2
fix
Jannis-Mittenzwei 145f27d
fix
Jannis-Mittenzwei e8bd0a2
fix
Jannis-Mittenzwei File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| .. _Getting Started: | ||
|
|
||
| Getting Started | ||
| =============== | ||
|
|
||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,94 @@ | ||
| import shutil | ||
| from unittest.mock import ( | ||
| MagicMock, | ||
| patch, | ||
| ) | ||
|
|
||
| import pytest | ||
|
|
||
| import exasol.toolbox.nox._documentation | ||
| from exasol.toolbox.nox._documentation import ( | ||
| _docs_links_check, | ||
| _docs_list_links, | ||
| ) | ||
| from noxconfig import Config | ||
|
|
||
|
|
||
| @pytest.fixture() | ||
| def file1(): | ||
| return """ | ||
| https://examle.invalid | ||
| :ref:`Test`""" | ||
|
|
||
|
|
||
| @pytest.fixture() | ||
| def index(): | ||
| return """.. _Test: | ||
Jannis-Mittenzwei marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Test | ||
| ____ | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 1 | ||
| :hidden: | ||
|
|
||
| file""" | ||
|
|
||
|
|
||
| @pytest.fixture() | ||
| def expected1(): | ||
| return """filename: file.rst:2 -> uri: https://examle.invalid""" | ||
|
|
||
|
|
||
| def config(index, file, tmp_path): | ||
| test_doc = tmp_path / "doc" | ||
| test_doc.mkdir() | ||
| (test_doc / "_static").mkdir() | ||
| shutil.copyfile(Config.doc / "conf.py", test_doc / "conf.py") | ||
| rst_index = test_doc / "index.rst" | ||
| rst_file1 = test_doc / "file.rst" | ||
| rst_index.touch() | ||
| rst_file1.touch() | ||
| rst_index.write_text(index) | ||
| rst_file1.write_text(file) | ||
|
|
||
|
|
||
| def test_docs_links(index, file1, expected1, tmp_path): | ||
| config(index, file1, tmp_path) | ||
| r_code, text = _docs_list_links(tmp_path / "doc") | ||
| assert (text == expected1) and not r_code | ||
|
|
||
|
|
||
| @pytest.mark.parametrize( | ||
| "file2, expected2", | ||
| [ | ||
| ("https://github.com/exasol/python-toolbox", (0, "")), | ||
| ( | ||
| "http://nox.thea.codes/en/stable/", | ||
| ( | ||
| 0, | ||
| "file.rst:1: [redirected with Found] http://nox.thea.codes/en/stable/ to https://nox.thea.codes/en/stable/\n", | ||
| ), | ||
| ), | ||
| ( | ||
| "https://github.com/exasol/python-toolbox/pull", | ||
| ( | ||
| 0, | ||
| "file.rst:1: [redirected permanently] https://github.com/exasol/python-toolbox/pull to https://github.com/exasol/python-toolbox/pulls\n", | ||
| ), | ||
| ), | ||
| ( | ||
| "https://github.com/exasol/python-toolbox/asdf", | ||
| ( | ||
| 1, | ||
| "file.rst:1: [broken] https://github.com/exasol/python-toolbox/asdf: 404 Client Error: Not Found for url: https://github.com/exasol/python-toolbox/asdf\n", | ||
| ), | ||
| ), | ||
| ], | ||
| ) | ||
| def test_docs_links_check(index, file2, expected2, tmp_path): | ||
| config(index, file2, tmp_path) | ||
| args = MagicMock | ||
| args.output = None | ||
| actual = _docs_links_check(tmp_path / "doc", args) | ||
| assert actual == expected2 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.