-
Notifications
You must be signed in to change notification settings - Fork 5
issue#50: fix partial_diff #163
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
Conversation
smart_kit/utils/diff.py
Outdated
if expected != actual and \ | ||
not (isinstance(actual, str) and isinstance(expected, str) and re.fullmatch(expected, actual)): | ||
if (not isinstance(actual, type(expected)) or | ||
(isinstance(actual, str) and isinstance(expected, str) and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(isinstance(actual, str) and isinstance(expected, str) and | |
(isinstance(actual, str) and |
Из предыдущего экспрешна следует, что типы совпадают
smart_kit/utils/diff.py
Outdated
@@ -20,8 +20,10 @@ def __init__(self): | |||
@classmethod | |||
def partial_diff(cls, expected: Any, actual: Any, path="", dict_check_does_not_expected=False) -> Diff: | |||
diff = cls() | |||
if expected != actual and \ | |||
not (isinstance(actual, str) and isinstance(expected, str) and re.fullmatch(expected, actual)): | |||
if (not isinstance(actual, type(expected)) or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (not isinstance(actual, type(expected)) or | |
if not isinstance(actual, type(expected) or |
smart_kit/utils/diff.py
Outdated
if (not isinstance(actual, type(expected)) or | ||
(isinstance(actual, str) and isinstance(expected, str) and | ||
expected != actual and not re.fullmatch(expected, actual)) or | ||
expected != actual): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Если там была регулярка, это зафейлится
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
фейл для регулярки
fix #50