3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-21 11:53:41 +01:00

[Tests] Remove spaces for string comparison due to different Osx Output format

This commit is contained in:
Nils Wentzell 2018-02-22 12:02:22 +01:00
parent 9731668cae
commit 78000328f1
2 changed files with 10 additions and 6 deletions

View File

@ -75,6 +75,7 @@ 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.],
@ -99,6 +100,7 @@ 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}]

View File

@ -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