-
Notifications
You must be signed in to change notification settings - Fork 936
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): validate doc parameters, report errors (#104)
- Loading branch information
1 parent
edc6a6f
commit 0bb0e34
Showing
10 changed files
with
1,137 additions
and
1,300 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,13 +1,26 @@ | ||
# Copyright (c) Microsoft Corporation. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from scripts.documentation_provider import DocumentationProvider | ||
|
||
|
||
def test_transform_documentation_entry() -> None: | ||
provider = DocumentationProvider() | ||
assert provider._transform_doc_entry(["<[Promise]<?[Error]>>"]) == [ | ||
"<Optional[Error]>" | ||
] | ||
assert provider._transform_doc_entry(["<[Frame]>"]) == ["<Frame>"] | ||
assert provider._transform_doc_entry(["<[function]|[string]|[Object]>"]) == [ | ||
"<[function]|[str]|[Dict]>" | ||
] | ||
assert provider._transform_doc_entry(["<?[Object]>"]) == ["<Optional[Dict]>"] | ||
assert provider._transform_doc_entry("<[Promise]<?[Error]>>") == "<Optional[Error]>" | ||
assert provider._transform_doc_entry("<[Frame]>") == "<Frame>" | ||
assert ( | ||
provider._transform_doc_entry("<[function]|[string]|[Object]>") | ||
== "<[function]|[str]|[Dict]>" | ||
) | ||
assert provider._transform_doc_entry("<?[Object]>") == "<Optional[Dict]>" |