Blog do projektu Open Source JavaHotel

niedziela, 11 września 2011

New version Boa tester

New version of Boa test framework.
In order to avoid CR/LF (DOS) and LF (Linux) hell I had to change a method for file comparison. I replaced standard filecmp.cmp function with manual line by line comparison. Source file.

  eq = filecmp.cmp(sou, dest)
  if not eq:"  different")
    res = 0

f1 = open(sou, "r")
 f2 = open(dest, "r")
 li1 = f1.readlines()
 li2 = f2.readlines()
 if len(li1) != len(li2) :" number of lines is different")
    res = 0
 for i in range(0, len(li1))  :
 line1 = li1[i].rstrip()
 line2 = li2[i].rstrip()
 if line1 != line2 :" line number: " + str(i)  + " different")
    res = 0

Brak komentarzy:

Publikowanie komentarza