From e0ce8848a762f63d243dd635e7f1c93aadd68f8c Mon Sep 17 00:00:00 2001 From: Grokzen Date: Sat, 10 Nov 2018 20:58:24 +0100 Subject: [PATCH] Fix linting issues --- pykwalify/core.py | 23 ----------------------- pykwalify/rule.py | 2 +- tests/files/partial_schemas/10f.yaml | 2 +- tests/test_core.py | 7 +++++++ 4 files changed, 9 insertions(+), 25 deletions(-) diff --git a/pykwalify/core.py b/pykwalify/core.py index a6c8dfe..8e79738 100644 --- a/pykwalify/core.py +++ b/pykwalify/core.py @@ -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): """ """ diff --git a/pykwalify/rule.py b/pykwalify/rule.py index 6e48525..a0a1975 100644 --- a/pykwalify/rule.py +++ b/pykwalify/rule.py @@ -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, diff --git a/tests/files/partial_schemas/10f.yaml b/tests/files/partial_schemas/10f.yaml index af8f78d..9074228 100644 --- a/tests/files/partial_schemas/10f.yaml +++ b/tests/files/partial_schemas/10f.yaml @@ -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'" diff --git a/tests/test_core.py b/tests/test_core.py index dd4f0eb..de7bd06 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -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