[Blends-commit] [SCM] website branch, master, updated. 71a05d63257c777448f1be9273767e195fd14607

Akshita Jha akshita-guest at users.alioth.debian.org
Tue Jul 28 21:39:33 UTC 2015


The following commit has been merged in the master branch:
commit 71a05d63257c777448f1be9273767e195fd14607
Author: Akshita Jha <akshita-guest at users.alioth.debian.org>
Date:   Wed Jul 29 03:04:37 2015 +0530

    Modify test_output.py : Make sure diff is not due to whitespaces only

diff --git a/webtools_py3/test_output.py b/webtools_py3/test_output.py
index 9dec16a..1ea7ba7 100755
--- a/webtools_py3/test_output.py
+++ b/webtools_py3/test_output.py
@@ -70,9 +70,8 @@ def check_diff(blend, tasks_files, outputdir):
         old_data = parser1.data
         final_old_data = []
         for od in old_data:
-            tmp = ''
             if od != '':
-                tmp = re.sub('\s+',' ',od) + '\n'  # remove extra spaces
+                tmp = " ".join(od.split())
             if tmp != ' ' or tmp != '' or tmp != '\n':    
                 final_old_data.append(tmp)
 
@@ -82,23 +81,19 @@ def check_diff(blend, tasks_files, outputdir):
         new_data = parser2.data
         final_new_data = []
         for nd in new_data:
-            tmp = ''
             if nd != '':
-                tmp = re.sub('\s+',' ',nd) + '\n'  # remove extra spaces
+                tmp = " ".join(nd.split())
             if tmp != ' ' or tmp != '' or tmp != '\n':
                 final_new_data.append(tmp)
 
-
         if final_old_data == final_new_data:
            print("Both the task files are identical") 
-
         
         fp = open(tmp_diff,'w')
         lines = []
-        for line in difflib.unified_diff(old_data, new_data, fromfile='tasks/'+f, tofile='tasks_udd/'+f, lineterm=""):
+        for line in difflib.unified_diff(final_old_data, final_new_data, fromfile='tasks/'+f, tofile='tasks_udd/'+f, lineterm=""):
             line = line + '\n'
             lines.append(line)
-        
         fp.writelines(lines)
         fp.close()
 

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list