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

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

Commit 5512c9198a708cd9915258648ca31a071fecdd35 in airflow's branch 
refs/heads/v1-10-stable from J
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=5512c91 ]

[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
>             Fix For: 1.10.3
>
>
> 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