Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error message for min and min-ex violations #195

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pykwalify/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ def _validate_length(self, rule, value, path, prefix):

if min_ is not None and min_ > value_length:
self.errors.append(SchemaError.SchemaErrorEntry(
msg=u"Value: '{value_str}' has length of '{value}', greater than min limit '{min_}'. Path: '{path}'",
msg=u"Value: '{value_str}' has length of '{value}', less than min limit '{min_}'. Path: '{path}'",
value_str=value,
path=path,
value=len(value),
Expand All @@ -898,7 +898,7 @@ def _validate_length(self, rule, value, path, prefix):

if max_ex is not None and max_ex <= value_length:
self.errors.append(SchemaError.SchemaErrorEntry(
msg=u"Value: '{value_str}' has length of '{value}', greater than max_ex limit '{max_ex}'. Path: '{path}'",
msg=u"Value: '{value_str}' has length of '{value}', greater than or equal to max_ex limit '{max_ex}'. Path: '{path}'",
value_str=value,
path=path,
value=len(value),
Expand All @@ -907,7 +907,7 @@ def _validate_length(self, rule, value, path, prefix):

if min_ex is not None and min_ex >= value_length:
self.errors.append(SchemaError.SchemaErrorEntry(
msg=u"Value: '{value_str}' has length of '{value}', greater than min_ex limit '{min_ex}'. Path: '{path}'",
msg=u"Value: '{value_str}' has length of '{value}', less than or equal to min_ex limit '{min_ex}'. Path: '{path}'",
value_str=value,
path=path,
value=len(value),
Expand Down