diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-11-18 10:15:03 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-11-18 10:15:03 +0000 |
commit | b284a3168fa91a038925d2ecf5e4791011ea5e7d (patch) | |
tree | 16fe44748708acacd909d4e2e160a09a7f6d936a /app-text/xlsx2csv/files | |
parent | 77398e424e45d9e98c1cef3c43bdadb9d56e81ef (diff) |
gentoo resync : 18.11.2019
Diffstat (limited to 'app-text/xlsx2csv/files')
-rw-r--r-- | app-text/xlsx2csv/files/xlsx2csv-0.7.6-tests.patch | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/app-text/xlsx2csv/files/xlsx2csv-0.7.6-tests.patch b/app-text/xlsx2csv/files/xlsx2csv-0.7.6-tests.patch new file mode 100644 index 000000000000..f3e04b827bd0 --- /dev/null +++ b/app-text/xlsx2csv/files/xlsx2csv-0.7.6-tests.patch @@ -0,0 +1,61 @@ +--- xlsx2csv-0.7.6/test/run ++++ xlsx2csv-0.7.6/test/run +@@ -5,8 +5,6 @@ + import subprocess + from io import open + +-PYTHON_VERSIONS = ["2.7"] +- + """ + This test uses sys.stdout. + That means this test doesn't verify: +@@ -16,31 +14,24 @@ + + def compare(case, arguments=[]): + failed = False +- for pyver in PYTHON_VERSIONS: +- ext = "xlsx" +- if os.path.exists("test/%s.xlsm" % case): +- ext = "xlsm" +- +- if os.name == 'posix':# in case of Linux +- left = subprocess.check_output(["python%s" %pyver, "./xlsx2csv.py"] + arguments + ["test/%s.%s" %(case, ext)]).decode('utf-8').replace('\r','') +- elif os.name == 'nt':# in case of Windows +- # Use py.exe http://blog.python.org/2011/07/python-launcher-for-windows_11.html on Windows +- left = subprocess.check_output(["py", "-%s" %pyver, "./xlsx2csv.py"] + arguments + ["test/%s.%s" %(case, ext)]).decode('utf-8').replace('\r','') +- else: +- print("os.name is unexpected: "+os.name) +- sys.exit(1) +- +- f = open("test/%s.csv" %case, "r", encoding="utf-8", newline="") +- right = f.read().replace('\r','') +- f.close() +- +- if left != right: +- print("FAILED: %s %s" %(case, pyver)) +- print(" actual:", left.replace("\r", "\\r").replace("\n", "\\n")) +- print(" expected:", right.replace("\r", "\\r").replace("\n", "\\n")) +- failed = True +- else: +- print("OK: %s %s" %(case, pyver)) ++ ext = "xlsx" ++ if os.path.exists("test/%s.xlsm" % case): ++ ext = "xlsm" ++ ++ left = subprocess.check_output(["./xlsx2csv.py"] + arguments + ["test/%s.%s" %(case, ext)]).decode('utf-8').replace('\r','') ++ ++ f = open("test/%s.csv" %case, "r", encoding="utf-8", newline="") ++ right = f.read().replace('\r','') ++ f.close() ++ ++ if left != right: ++ print("FAILED: %s" % (case,)) ++ print(" actual:", left.replace("\r", "\\r").replace("\n", "\\n")) ++ print(" expected:", right.replace("\r", "\\r").replace("\n", "\\n")) ++ failed = True ++ else: ++ print("OK: %s" % (case,)) ++ + if failed: + sys.exit(1) + |