Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33
improve logging in shortcuts.py and turn to pytest in test_shortcut.py#219
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Open
even-even wants to merge2 commits intopython-openapi:masterChoose a base branch fromeven-even:improve_shotcuts_and_add_test
base:master
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Uh oh!
There was an error while loading.Please reload this page.
Open
Changes fromall commits
Commits
Show all changes
2 commits Select commitHold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletiondocs/index.rst
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 |
---|---|---|
@@ -20,7 +20,7 @@ Installation | ||
.. md-tab-set:: | ||
.. md-tab-item:: Pip + PyPI (recommended) | ||
.. code-block:: console | ||
5 changes: 1 addition & 4 deletionsopenapi_schema_validator/_keywords.py
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
13 changes: 13 additions & 0 deletionsopenapi_schema_validator/shortcuts.py
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
4 changes: 0 additions & 4 deletionsopenapi_schema_validator/validators.py
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
42 changes: 27 additions & 15 deletionstests/unit/test_shortcut.py
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,21 +1,33 @@ | ||
import pytest | ||
from openapi_schema_validator import validate | ||
@pytest.fixture(scope="function") | ||
def schema(): | ||
return { | ||
"type": "object", | ||
"properties": { | ||
"email": {"type": "string"}, | ||
"enabled": { | ||
"type": "boolean", | ||
}, | ||
}, | ||
"example": {"enabled": False, "email": "foo@bar.com"}, | ||
} | ||
def test_validate_does_not_add_nullable_to_schema(schema): | ||
""" | ||
Verify that calling validate does not add the 'nullable' key to the schema | ||
""" | ||
validate({"email": "foo@bar.com"}, schema) | ||
assert "nullable" not in schema["properties"]["email"].keys() | ||
def test_validate_does_not_mutate_schema(schema): | ||
""" | ||
Verify that calling validate does not mutate the schema | ||
""" | ||
original_schema = schema.copy() | ||
validate({"email": "foo@bar.com"}, schema) | ||
assert schema == original_schema |
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.