forked from strictdoc-project/strictdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request strictdoc-project#1481 from strictdoc-project/stan…
…islaw/rst UI: Create Document validations: document path is not white-/blacklisted in the config
- Loading branch information
Showing
13 changed files
with
162 additions
and
1 deletion.
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
Empty file.
2 changes: 2 additions & 0 deletions
2
...cument_validate_document_path_inside_of_exclude_filter/expected_output/docs/document.sdoc
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,2 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 |
9 changes: 9 additions & 0 deletions
9
...e_document_validate_document_path_inside_of_exclude_filter/expected_output/strictdoc.toml
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,9 @@ | ||
[project] | ||
|
||
features = [ | ||
|
||
] | ||
|
||
exclude_doc_paths = [ | ||
"tests/**", | ||
] |
9 changes: 9 additions & 0 deletions
9
...tion/create_document_validate_document_path_inside_of_exclude_filter/input/strictdoc.toml
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,9 @@ | ||
[project] | ||
|
||
features = [ | ||
|
||
] | ||
|
||
exclude_doc_paths = [ | ||
"tests/**", | ||
] |
43 changes: 43 additions & 0 deletions
43
.../_validation/create_document_validate_document_path_inside_of_exclude_filter/test_case.py
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,43 @@ | ||
from tests.end2end.e2e_case import E2ECase | ||
from tests.end2end.end2end_test_setup import End2EndTestSetup | ||
from tests.end2end.helpers.screens.project_index.form_add_document import ( | ||
Form_AddDocument, | ||
) | ||
from tests.end2end.helpers.screens.project_index.screen_project_index import ( | ||
Screen_ProjectIndex, | ||
) | ||
from tests.end2end.server import SDocTestServer | ||
|
||
|
||
class Test(E2ECase): | ||
def test(self): | ||
test_setup = End2EndTestSetup(path_to_test_file=__file__) | ||
|
||
with SDocTestServer( | ||
input_path=test_setup.path_to_sandbox | ||
) as test_server: | ||
self.open(test_server.get_host_and_port()) | ||
|
||
screen_project_index = Screen_ProjectIndex(self) | ||
screen_project_index.assert_on_screen() | ||
screen_project_index.assert_empty_tree() | ||
|
||
form_add_document: Form_AddDocument = ( | ||
screen_project_index.do_open_modal_form_add_document() | ||
) | ||
form_add_document.do_fill_in_title("Document 1") | ||
|
||
# First, fill in an invalid path. | ||
form_add_document.do_fill_in_path("tests/document") | ||
form_add_document.do_form_submit_and_catch_error( | ||
"Document path is not a valid path according to the project " | ||
"config's setting 'exclude_doc_paths': ['tests/**']." | ||
) | ||
|
||
# Then, fill in a valid path. | ||
form_add_document.do_fill_in_path("docs/document") | ||
form_add_document.do_form_submit() | ||
|
||
screen_project_index.assert_contains_document("Document 1") | ||
|
||
assert test_setup.compare_sandbox_and_expected_output() |
Empty file.
2 changes: 2 additions & 0 deletions
2
...ument_validate_document_path_outside_of_include_filter/expected_output/docs/document.sdoc
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,2 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 |
9 changes: 9 additions & 0 deletions
9
..._document_validate_document_path_outside_of_include_filter/expected_output/strictdoc.toml
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,9 @@ | ||
[project] | ||
|
||
features = [ | ||
|
||
] | ||
|
||
include_doc_paths = [ | ||
"docs/**", | ||
] |
9 changes: 9 additions & 0 deletions
9
...ion/create_document_validate_document_path_outside_of_include_filter/input/strictdoc.toml
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,9 @@ | ||
[project] | ||
|
||
features = [ | ||
|
||
] | ||
|
||
include_doc_paths = [ | ||
"docs/**", | ||
] |
43 changes: 43 additions & 0 deletions
43
..._validation/create_document_validate_document_path_outside_of_include_filter/test_case.py
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,43 @@ | ||
from tests.end2end.e2e_case import E2ECase | ||
from tests.end2end.end2end_test_setup import End2EndTestSetup | ||
from tests.end2end.helpers.screens.project_index.form_add_document import ( | ||
Form_AddDocument, | ||
) | ||
from tests.end2end.helpers.screens.project_index.screen_project_index import ( | ||
Screen_ProjectIndex, | ||
) | ||
from tests.end2end.server import SDocTestServer | ||
|
||
|
||
class Test(E2ECase): | ||
def test(self): | ||
test_setup = End2EndTestSetup(path_to_test_file=__file__) | ||
|
||
with SDocTestServer( | ||
input_path=test_setup.path_to_sandbox | ||
) as test_server: | ||
self.open(test_server.get_host_and_port()) | ||
|
||
screen_project_index = Screen_ProjectIndex(self) | ||
screen_project_index.assert_on_screen() | ||
screen_project_index.assert_empty_tree() | ||
|
||
form_add_document: Form_AddDocument = ( | ||
screen_project_index.do_open_modal_form_add_document() | ||
) | ||
form_add_document.do_fill_in_title("Document 1") | ||
|
||
# First, fill in an invalid path. | ||
form_add_document.do_fill_in_path("document") | ||
form_add_document.do_form_submit_and_catch_error( | ||
"Document path is not a valid path according to the project " | ||
"config's setting 'include_doc_paths': ['docs/**']." | ||
) | ||
|
||
# Then, fill in a valid path. | ||
form_add_document.do_fill_in_path("docs/document") | ||
form_add_document.do_form_submit() | ||
|
||
screen_project_index.assert_contains_document("Document 1") | ||
|
||
assert test_setup.compare_sandbox_and_expected_output() |
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