You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Julia (JIRA)" <ji...@apache.org> on 2019/03/09 19:41:00 UTC
[jira] [Created] (AIRFLOW-4054) assertEqualIgnoreMultipleSpaces
doesn't have test and passes when it should fail
Julia created AIRFLOW-4054:
------------------------------
Summary: assertEqualIgnoreMultipleSpaces doesn't have test and passes when it should fail
Key: AIRFLOW-4054
URL: https://issues.apache.org/jira/browse/AIRFLOW-4054
Project: Apache Airflow
Issue Type: Bug
Components: utils
Reporter: Julia
assertEqualIgnoreMultipleSpaces util is supposed to compare two strings trimming white spaces. Currently assertion passes even when strings are completely different. No tests exist for this.
{code:java}
def assertEqualIgnoreMultipleSpaces(case, first, second, msg=None):
def _trim(s):
re.sub(r"\s+", " ", s.strip())
return case.assertEqual(_trim(first), _trim(second), msg)
{code}
Reason is that _trim(s) method doesn't have a return statement, therefore returning None for first and second trimmed string. Is causes assertEqual compare None with None, forcing assertion assertEqualIgnoreMultipleSpaces to pass.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)