diff --git a/test/plovasp/inpconf/test_input.py b/test/plovasp/inpconf/test_input.py index 89418fdb..c19735c9 100644 --- a/test/plovasp/inpconf/test_input.py +++ b/test/plovasp/inpconf/test_input.py @@ -75,14 +75,15 @@ class TestParseInput(arraytest.ArrayTestCase): res += conf_pars.shells.__repr__() + '\n\n' res += "Groups:\n" res += conf_pars.groups.__repr__() + res = res.replace(" ","") # Remove spaces for comparison expected = r"""Shells: -[{'ion_list': array([4, 5, 6, 7]), 'user_index': 1, 'lshell': 2}, {'tmatrix': array([[ 0., 1., 0.], - [ 1., 0., 0.], - [ 0., 0., 1.]]), 'ion_list': array([0, 1, 2, 3]), 'user_index': 2, 'lshell': 1}, {'ion_list': array([0, 1, 2, 3]), 'user_index': 3, 'lshell': 3}] +[{'ion_list':array([4,5,6,7]),'user_index':1,'lshell':2},{'tmatrix':array([[0.,1.,0.], +[1.,0.,0.], +[0.,0.,1.]]),'ion_list':array([0,1,2,3]),'user_index':2,'lshell':1},{'ion_list':array([0,1,2,3]),'user_index':3,'lshell':3}] Groups: -[{'normalize': True, 'index': 1, 'ewindow': (-7.6, 3.0), 'normion': True, 'shells': [0, 1]}, {'normalize': True, 'index': 2, 'ewindow': (-1.6, 2.0), 'normion': True, 'shells': [2]}]""" +[{'normalize':True,'index':1,'ewindow':(-7.6,3.0),'normion':True,'shells':[0,1]},{'normalize':True,'index':2,'ewindow':(-1.6,2.0),'normion':True,'shells':[2]}]""" self.assertEqual(res, expected) @@ -99,12 +100,13 @@ Groups: res += conf_pars.shells.__repr__() + '\n\n' res += "Groups:\n" res += conf_pars.groups.__repr__() + res = res.replace(" ","") # Remove spaces for comparison expected = r"""Shells: -[{'ion_list': array([4, 5, 6, 7]), 'user_index': 1, 'lshell': 2}] +[{'ion_list':array([4,5,6,7]),'user_index':1,'lshell':2}] Groups: -[{'normalize': True, 'index': '1', 'ewindow': (-7.6, 3.0), 'shells': [0], 'normion': True}]""" +[{'normalize':True,'index':'1','ewindow':(-7.6,3.0),'shells':[0],'normion':True}]""" self.assertEqual(res, expected) diff --git a/test/plovasp/vaspio/mytest.py b/test/plovasp/vaspio/mytest.py index fb0c64e8..f92cba6d 100644 --- a/test/plovasp/vaspio/mytest.py +++ b/test/plovasp/vaspio/mytest.py @@ -45,7 +45,9 @@ class MyTestCase(unittest.TestCase): # # Remove empty lines lstr1 = filter(lambda s: s.strip() != '', str1.splitlines(True)) + lstr1 = [str1.replace(" ","") for str1 in lstr1] # Remove spaces lstr2 = filter(lambda s: s.strip() != '', str2.splitlines(True)) + lstr2 = [str2.replace(" ","") for str2 in lstr2] # Remove spaces # diff delta = difflib.unified_diff(lstr1, lstr2) # combine delta's to a string