Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Grokzen committed Oct 9, 2019
1 parent 6505209 commit e0ce884
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 25 deletions.
23 changes: 0 additions & 23 deletions pykwalify/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,29 +284,6 @@ def _handle_func(self, value, rule, path, done=None):
if not found_method:
raise CoreError(u"Did not find method '{0}' in any loaded extension file".format(func))

# def _validate_include(self, value, rule, path, done=None):
# """
# """
# # TODO: It is difficult to get a good test case to trigger this if case
# if rule.include_name is None:
# self.errors.append(SchemaError.SchemaErrorEntry(
# msg=u'Include name not valid',
# path=path,
# value=value.encode('unicode_escape')))
# return
# include_name = rule.include_name
# partial_schema_rule = pykwalify.partial_schemas.get(include_name)
# if not partial_schema_rule:
# self.errors.append(SchemaError.SchemaErrorEntry(
# msg=u"Cannot find partial schema with name '{include_name}'. Existing partial schemas: '{existing_schemas}'. Path: '{path}'",
# path=path,
# value=value,
# include_name=include_name,
# existing_schemas=", ".join(sorted(pykwalify.partial_schemas.keys()))))
# return
#
# self._validate(value, partial_schema_rule, path, done)

def _validate_sequence(self, value, rule, path, done=None):
"""
"""
Expand Down
2 changes: 1 addition & 1 deletion pykwalify/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# pykwalify imports
from pykwalify.compat import basestring
from pykwalify.errors import SchemaConflict, RuleError, SchemaError
from pykwalify.errors import SchemaConflict, RuleError
from pykwalify.types import (
DEFAULT_TYPE,
is_bool,
Expand Down
2 changes: 1 addition & 1 deletion tests/files/partial_schemas/10f.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ partial-files:

fail-exception-class: "SchemaError"
fail-validation-errors:
- "Cannot find required key 'y'. Path: '/point'.: Path: '/'"
- "Cannot find required key 'y'. Path: '/point'"
7 changes: 7 additions & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,13 @@ def test_multi_file_support(self):
)
c.validate()

compare(
sorted(c.validation_errors),
sorted(fail_validation_errors),
prefix="Wrong validation errors when parsing file : {0}".format(
fail_test,
)
)

def test_core_files(self):
# These tests should pass with no exception raised
Expand Down

0 comments on commit e0ce884

Please sign in to comment.