From d93b4753ab1963c3bcd942888362c255aa20f600 Mon Sep 17 00:00:00 2001 From: esy Date: Mon, 8 Nov 2021 17:08:11 +0100 Subject: [PATCH] Use temporary name of exported file in tests related to Part's export/import --- src/ExchangePlugin/Test/TestExportPart_Failure_1.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_Failure_2.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_Failure_3.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_FullPartSet.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_FullPart_1.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_FullPart_2.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_PartSet.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_Results_1.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_Results_2.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_Results_3.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_Results_4.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_Results_5.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_Results_6.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_Results_7.py | 4 ++-- src/ExchangePlugin/Test/TestExportPart_Results_8.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_AfterCurrent_1.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_AfterCurrent_2.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_AfterLast_1.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_AfterLast_2.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_AfterLast_3.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_AfterLast_4.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_AfterLast_5.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_AfterLast_6.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_Construction_1.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_Construction_2.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_Construction_3.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_Construction_4.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_Multiple.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_ToEmptyPart.py | 4 ++-- src/ExchangePlugin/Test/TestImportPart_ToEmptyPartSet.py | 4 ++-- 30 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/ExchangePlugin/Test/TestExportPart_Failure_1.py b/src/ExchangePlugin/Test/TestExportPart_Failure_1.py index ce36e4026..ea3e0be53 100644 --- a/src/ExchangePlugin/Test/TestExportPart_Failure_1.py +++ b/src/ExchangePlugin/Test/TestExportPart_Failure_1.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) model.begin() model.exportPart(partSet, filename, [Part_1.result()]) diff --git a/src/ExchangePlugin/Test/TestExportPart_Failure_2.py b/src/ExchangePlugin/Test/TestExportPart_Failure_2.py index 75fbcb896..2be17e027 100644 --- a/src/ExchangePlugin/Test/TestExportPart_Failure_2.py +++ b/src/ExchangePlugin/Test/TestExportPart_Failure_2.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) featureToExport = Box_1 diff --git a/src/ExchangePlugin/Test/TestExportPart_Failure_3.py b/src/ExchangePlugin/Test/TestExportPart_Failure_3.py index d24a81936..d30e0d487 100644 --- a/src/ExchangePlugin/Test/TestExportPart_Failure_3.py +++ b/src/ExchangePlugin/Test/TestExportPart_Failure_3.py @@ -31,8 +31,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) model.begin() model.exportPart(partSet, filename) diff --git a/src/ExchangePlugin/Test/TestExportPart_FullPartSet.py b/src/ExchangePlugin/Test/TestExportPart_FullPartSet.py index 0f6bfa2f9..62abbfed2 100644 --- a/src/ExchangePlugin/Test/TestExportPart_FullPartSet.py +++ b/src/ExchangePlugin/Test/TestExportPart_FullPartSet.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) model.begin() model.exportPart(partSet, filename) diff --git a/src/ExchangePlugin/Test/TestExportPart_FullPart_1.py b/src/ExchangePlugin/Test/TestExportPart_FullPart_1.py index 8c48bb60c..e4189a3f9 100644 --- a/src/ExchangePlugin/Test/TestExportPart_FullPart_1.py +++ b/src/ExchangePlugin/Test/TestExportPart_FullPart_1.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) model.begin() model.exportPart(Part_1_doc, filename) diff --git a/src/ExchangePlugin/Test/TestExportPart_FullPart_2.py b/src/ExchangePlugin/Test/TestExportPart_FullPart_2.py index 060ee5d62..fdbeaa255 100644 --- a/src/ExchangePlugin/Test/TestExportPart_FullPart_2.py +++ b/src/ExchangePlugin/Test/TestExportPart_FullPart_2.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) model.begin() model.exportPart(Part_2_doc, filename) diff --git a/src/ExchangePlugin/Test/TestExportPart_PartSet.py b/src/ExchangePlugin/Test/TestExportPart_PartSet.py index 09a8528cc..3cbf5e446 100644 --- a/src/ExchangePlugin/Test/TestExportPart_PartSet.py +++ b/src/ExchangePlugin/Test/TestExportPart_PartSet.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) model.begin() model.exportPart(partSet, filename, [Axis_4.result()]) diff --git a/src/ExchangePlugin/Test/TestExportPart_Results_1.py b/src/ExchangePlugin/Test/TestExportPart_Results_1.py index 831f36e96..be9916fad 100644 --- a/src/ExchangePlugin/Test/TestExportPart_Results_1.py +++ b/src/ExchangePlugin/Test/TestExportPart_Results_1.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) featureToExport = Point_2 diff --git a/src/ExchangePlugin/Test/TestExportPart_Results_2.py b/src/ExchangePlugin/Test/TestExportPart_Results_2.py index 491d35b18..317303b61 100644 --- a/src/ExchangePlugin/Test/TestExportPart_Results_2.py +++ b/src/ExchangePlugin/Test/TestExportPart_Results_2.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) featureToExport = Axis_4 diff --git a/src/ExchangePlugin/Test/TestExportPart_Results_3.py b/src/ExchangePlugin/Test/TestExportPart_Results_3.py index 591a87670..e31c03104 100644 --- a/src/ExchangePlugin/Test/TestExportPart_Results_3.py +++ b/src/ExchangePlugin/Test/TestExportPart_Results_3.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) featureToExport = Sketch_1 diff --git a/src/ExchangePlugin/Test/TestExportPart_Results_4.py b/src/ExchangePlugin/Test/TestExportPart_Results_4.py index c2b94262f..d8b01a6db 100644 --- a/src/ExchangePlugin/Test/TestExportPart_Results_4.py +++ b/src/ExchangePlugin/Test/TestExportPart_Results_4.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) featureToExport = Extrusion_1 diff --git a/src/ExchangePlugin/Test/TestExportPart_Results_5.py b/src/ExchangePlugin/Test/TestExportPart_Results_5.py index da6be8779..db5a4a6e0 100644 --- a/src/ExchangePlugin/Test/TestExportPart_Results_5.py +++ b/src/ExchangePlugin/Test/TestExportPart_Results_5.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) featureToExport = Sketch_2 diff --git a/src/ExchangePlugin/Test/TestExportPart_Results_6.py b/src/ExchangePlugin/Test/TestExportPart_Results_6.py index 924bb362e..d81ae61e5 100644 --- a/src/ExchangePlugin/Test/TestExportPart_Results_6.py +++ b/src/ExchangePlugin/Test/TestExportPart_Results_6.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) featureToExport = Revolution_1 diff --git a/src/ExchangePlugin/Test/TestExportPart_Results_7.py b/src/ExchangePlugin/Test/TestExportPart_Results_7.py index 5debe9bfc..9a5ac4ec4 100644 --- a/src/ExchangePlugin/Test/TestExportPart_Results_7.py +++ b/src/ExchangePlugin/Test/TestExportPart_Results_7.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) featureToExport = Box_1 diff --git a/src/ExchangePlugin/Test/TestExportPart_Results_8.py b/src/ExchangePlugin/Test/TestExportPart_Results_8.py index 869cd936b..0db5a9042 100644 --- a/src/ExchangePlugin/Test/TestExportPart_Results_8.py +++ b/src/ExchangePlugin/Test/TestExportPart_Results_8.py @@ -63,8 +63,8 @@ model.end() import os -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) featureToExport = Translation_1 diff --git a/src/ExchangePlugin/Test/TestImportPart_AfterCurrent_1.py b/src/ExchangePlugin/Test/TestImportPart_AfterCurrent_1.py index 2521fdfe4..5e67113b6 100644 --- a/src/ExchangePlugin/Test/TestImportPart_AfterCurrent_1.py +++ b/src/ExchangePlugin/Test/TestImportPart_AfterCurrent_1.py @@ -34,8 +34,8 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), mod model.do() model.end() -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) # store the reference data features = Part_1_doc.allFeatures() diff --git a/src/ExchangePlugin/Test/TestImportPart_AfterCurrent_2.py b/src/ExchangePlugin/Test/TestImportPart_AfterCurrent_2.py index 5742c570f..5d79c5b24 100644 --- a/src/ExchangePlugin/Test/TestImportPart_AfterCurrent_2.py +++ b/src/ExchangePlugin/Test/TestImportPart_AfterCurrent_2.py @@ -34,8 +34,8 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), mod model.do() model.end() -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) # store the reference data features = Part_1_doc.allFeatures() diff --git a/src/ExchangePlugin/Test/TestImportPart_AfterLast_1.py b/src/ExchangePlugin/Test/TestImportPart_AfterLast_1.py index 8bc87e142..14acc7ec0 100644 --- a/src/ExchangePlugin/Test/TestImportPart_AfterLast_1.py +++ b/src/ExchangePlugin/Test/TestImportPart_AfterLast_1.py @@ -64,8 +64,8 @@ model.do() model.end() -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) # store the reference data features = [Point_2.feature(), Axis_4.feature()] diff --git a/src/ExchangePlugin/Test/TestImportPart_AfterLast_2.py b/src/ExchangePlugin/Test/TestImportPart_AfterLast_2.py index dd901e42b..40cb64c43 100644 --- a/src/ExchangePlugin/Test/TestImportPart_AfterLast_2.py +++ b/src/ExchangePlugin/Test/TestImportPart_AfterLast_2.py @@ -65,8 +65,8 @@ model.do() model.end() -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) featureToExport = Sketch_1 diff --git a/src/ExchangePlugin/Test/TestImportPart_AfterLast_3.py b/src/ExchangePlugin/Test/TestImportPart_AfterLast_3.py index 415b5fee4..ce5057a16 100644 --- a/src/ExchangePlugin/Test/TestImportPart_AfterLast_3.py +++ b/src/ExchangePlugin/Test/TestImportPart_AfterLast_3.py @@ -64,8 +64,8 @@ model.do() model.end() -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) featureToExport = Box_1 diff --git a/src/ExchangePlugin/Test/TestImportPart_AfterLast_4.py b/src/ExchangePlugin/Test/TestImportPart_AfterLast_4.py index cb6a8cc7c..ae305fc72 100644 --- a/src/ExchangePlugin/Test/TestImportPart_AfterLast_4.py +++ b/src/ExchangePlugin/Test/TestImportPart_AfterLast_4.py @@ -64,8 +64,8 @@ model.do() model.end() -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) featureToExport = Translation_1 diff --git a/src/ExchangePlugin/Test/TestImportPart_AfterLast_5.py b/src/ExchangePlugin/Test/TestImportPart_AfterLast_5.py index dd6d91d7c..6c381dac2 100644 --- a/src/ExchangePlugin/Test/TestImportPart_AfterLast_5.py +++ b/src/ExchangePlugin/Test/TestImportPart_AfterLast_5.py @@ -65,8 +65,8 @@ model.do() model.end() -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) # store the reference data features = [Box_1.feature(), Plane_4.feature()] diff --git a/src/ExchangePlugin/Test/TestImportPart_AfterLast_6.py b/src/ExchangePlugin/Test/TestImportPart_AfterLast_6.py index 45f6ac862..139022dc8 100644 --- a/src/ExchangePlugin/Test/TestImportPart_AfterLast_6.py +++ b/src/ExchangePlugin/Test/TestImportPart_AfterLast_6.py @@ -65,8 +65,8 @@ model.do() model.end() -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) # store the reference data features = [Box_1.feature(), Translation_1.feature()] diff --git a/src/ExchangePlugin/Test/TestImportPart_Construction_1.py b/src/ExchangePlugin/Test/TestImportPart_Construction_1.py index 7b851bdce..a6920f319 100644 --- a/src/ExchangePlugin/Test/TestImportPart_Construction_1.py +++ b/src/ExchangePlugin/Test/TestImportPart_Construction_1.py @@ -49,8 +49,8 @@ for feat in features: res.append(GeomAlgoAPI_ShapeTools.volume(r.shape())) refData.append( (feat.getKind(), res) ) -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) # emport the document model.begin() diff --git a/src/ExchangePlugin/Test/TestImportPart_Construction_2.py b/src/ExchangePlugin/Test/TestImportPart_Construction_2.py index acb76f9ec..0ccd9504e 100644 --- a/src/ExchangePlugin/Test/TestImportPart_Construction_2.py +++ b/src/ExchangePlugin/Test/TestImportPart_Construction_2.py @@ -51,8 +51,8 @@ for feat in features: res.append(GeomAlgoAPI_ShapeTools.volume(r.shape())) refData.append( (feat.getKind(), res) ) -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) # emport the document model.begin() diff --git a/src/ExchangePlugin/Test/TestImportPart_Construction_3.py b/src/ExchangePlugin/Test/TestImportPart_Construction_3.py index 08fbef036..f73fa94a3 100644 --- a/src/ExchangePlugin/Test/TestImportPart_Construction_3.py +++ b/src/ExchangePlugin/Test/TestImportPart_Construction_3.py @@ -51,8 +51,8 @@ for feat in features: res.append(GeomAlgoAPI_ShapeTools.volume(r.shape())) refData.append( (feat.getKind(), res) ) -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) # emport the document model.begin() diff --git a/src/ExchangePlugin/Test/TestImportPart_Construction_4.py b/src/ExchangePlugin/Test/TestImportPart_Construction_4.py index 642a15443..b9394c249 100644 --- a/src/ExchangePlugin/Test/TestImportPart_Construction_4.py +++ b/src/ExchangePlugin/Test/TestImportPart_Construction_4.py @@ -51,8 +51,8 @@ for feat in features: res.append(GeomAlgoAPI_ShapeTools.volume(r.shape())) refData.append( (feat.getKind(), res) ) -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) # emport the document model.begin() diff --git a/src/ExchangePlugin/Test/TestImportPart_Multiple.py b/src/ExchangePlugin/Test/TestImportPart_Multiple.py index 8ba713cc1..9227c81d4 100644 --- a/src/ExchangePlugin/Test/TestImportPart_Multiple.py +++ b/src/ExchangePlugin/Test/TestImportPart_Multiple.py @@ -36,8 +36,8 @@ Plane_4 = model.addPlane(Part_1_doc, model.selection("FACE", "PartSet/YOZ"), mod model.do() model.end() -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) # export all features from Part_1 model.begin() diff --git a/src/ExchangePlugin/Test/TestImportPart_ToEmptyPart.py b/src/ExchangePlugin/Test/TestImportPart_ToEmptyPart.py index b314bd387..0adc58717 100644 --- a/src/ExchangePlugin/Test/TestImportPart_ToEmptyPart.py +++ b/src/ExchangePlugin/Test/TestImportPart_ToEmptyPart.py @@ -67,8 +67,8 @@ for feat in features: res.append(GeomAlgoAPI_ShapeTools.volume(r.shape())) refData.append( (feat.getKind(), res) ) -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) # emport the document model.begin() diff --git a/src/ExchangePlugin/Test/TestImportPart_ToEmptyPartSet.py b/src/ExchangePlugin/Test/TestImportPart_ToEmptyPartSet.py index 5a3bd8549..89e124e4c 100644 --- a/src/ExchangePlugin/Test/TestImportPart_ToEmptyPartSet.py +++ b/src/ExchangePlugin/Test/TestImportPart_ToEmptyPartSet.py @@ -67,8 +67,8 @@ for feat in features: res.append(GeomAlgoAPI_ShapeTools.volume(r.shape())) refData.append( (feat.getKind(), res) ) -filename = 'check_export.shaperpart' -model.removeFile(filename) +filename = model.getTmpFileName('check_export', '.shaperpart') +model.removeTmpFile(filename) # emport the document model.begin() -- 2.39.2