Skip to content

Commit

Permalink
review changes, flake
Browse files Browse the repository at this point in the history
  • Loading branch information
willronchetti committed Aug 3, 2023
1 parent c62aff3 commit 1b46fc4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Change Log

* Updates ``jsonschema`` version, removing dependency on ``jsonschema-serialize-fork`` and allowing
us to use ``$merge`` refs.
* Breaking Change: dependencies --> dependentRequired in schema
* Breaking Change: object serialization in schema no longer valid


9.1.1
Expand Down
4 changes: 1 addition & 3 deletions snovault/schema_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ def server_default(func):


class NoRemoteResolver(RefResolver):
""" This has been modified to allow remote resolution that does not involve an http, https or ftp url
ie: local remote resolution """
def resolve_remote(self, uri):
raise ValueError(f'Resolution disallowed for: {uri}')

Expand Down Expand Up @@ -82,7 +80,7 @@ def favor_app_specific_schema_ref(schema_ref: str) -> str:
def json_file_contains_element(json_filename: str, json_element: str) -> bool:
"""
If the given JSON file exists and contains the given JSON element name then
returns True, otherwise returnes False. The given JSON element may or may
returns True; otherwise returns False. The given JSON element may or may
not begin with a slash. Currently only looks at one single top-level element.
"""
if json_filename and json_element:
Expand Down
4 changes: 4 additions & 0 deletions snovault/tests/test_schema_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def custom_resolver(ref, resolver):

def test_schema_utils_handle_list_or_string_value(mocker):
resolve_merge_ref = mocker.patch('snovault.schema_utils.resolve_merge_ref')

def custom_resolver(ref, resolver):
if ref == 'xyz':
return {
Expand Down Expand Up @@ -87,6 +88,7 @@ def custom_resolver(ref, resolver):
'and': 'a ref',
'inside': 'of a ref'
}

def custom_resolver(ref, resolver):
if ref == 'xyz':
return {
Expand All @@ -104,6 +106,7 @@ def custom_resolver(ref, resolver):
'a': 'b',
'c': 'd',
}

def custom_resolver(ref, resolver):
if ref == 'xyz':
return {
Expand Down Expand Up @@ -222,6 +225,7 @@ def test_schema_utils_resolve_merge_refs_fills_in_refs(mocker):
]
}
}

def custom_resolver(ref, resolver):
if ref == 'xyz':
return {
Expand Down
4 changes: 1 addition & 3 deletions snovault/tests/test_validator.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import pytest


import pytest # noQA
from snovault.schema_validation import NO_DEFAULT
from snovault.schema_utils import SchemaValidator
from jsonschema.exceptions import ValidationError
Expand Down

0 comments on commit 1b46fc4

Please sign in to comment.