From: Artem Zhidkov Date: Mon, 15 Jun 2020 13:37:13 +0000 (+0300) Subject: Fix failures of the exchange test cases on Windows X-Git-Tag: V9_5_0rc1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c5060d16e801a4cdb82257f091c71451459616e0;p=modules%2Fshaper.git Fix failures of the exchange test cases on Windows --- diff --git a/src/ConnectorAPI/Test/__main__.py b/src/ConnectorAPI/Test/__main__.py new file mode 100644 index 000000000..02a198310 --- /dev/null +++ b/src/ConnectorAPI/Test/__main__.py @@ -0,0 +1,24 @@ +# Copyright (C) 2016-2020 CEA/DEN, EDF R&D +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# ============================================================ # +# # +# Attention: Keep this file for correct execution on Windows # +# # +# ============================================================ # diff --git a/src/ExchangePlugin/Test/TestExport.py b/src/ExchangePlugin/Test/TestExport.py index 72e1a15e1..511b95835 100644 --- a/src/ExchangePlugin/Test/TestExport.py +++ b/src/ExchangePlugin/Test/TestExport.py @@ -157,8 +157,15 @@ def testExportXAO(theFile, theEmptyFormat = False): # Check exported file aRefPath = os.path.join(os.getenv("DATA_DIR"), "Shapes", "Xao", "box2.xao") - import filecmp - assert filecmp.cmp(theFile, aRefPath) + # endlines may be different on different platforms, thus compare files line-by-line + areFilesEqual = True + with open(theFile, 'r') as file, open(aRefPath, 'r') as ref: + l1 = l2 = True + while l1 and l2 and areFilesEqual: + l1 = file.readline() + l2 = ref.readline() + areFilesEqual = l1 == l2 + assert areFilesEqual if __name__ == '__main__': with TemporaryDirectory() as tmp_dir: