[ 
https://issues.apache.org/jira/browse/AIRFLOW-4054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16788806#comment-16788806
 ] 

ASF subversion and git services commented on AIRFLOW-4054:
----------------------------------------------------------

Commit 30660f2e77845f53741324356e2aa678488c596f in airflow's branch 
refs/heads/master from J
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=30660f2 ]

[AIRFLOW-4054] Fix assertEqualIgnoreMultipleSpaces util & add tests (#4886)



> 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
>            Assignee: Julia
>            Priority: Major
>
> 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)

Reply via email to