Remove test from old location

This commit is contained in:
Kevin Martin
2025-11-05 07:46:20 -05:00
parent 5afe1e64f8
commit 520dd7b2b7

View File

@@ -681,51 +681,6 @@ class DocumentBasicCases(unittest.TestCase):
# closing doc
FreeCAD.closeDocument("CreateTest")
class DocumentImportCases(unittest.TestCase):
def testDXFImportCPPIssue20195(self):
if "BUILD_DRAFT" in FreeCAD.__cmake__:
import importDXF
from draftutils import params
# Set options, doing our best to restore them:
wasShowDialog = params.get_param("dxfShowDialog")
wasUseLayers = params.get_param("dxfUseDraftVisGroups")
wasUseLegacyImporter = params.get_param("dxfUseLegacyImporter")
wasCreatePart = params.get_param("dxfCreatePart")
wasCreateDraft = params.get_param("dxfCreateDraft")
wasCreateSketch = params.get_param("dxfCreateSketch")
try:
# disable Preferences dialog in gui mode (avoids popup prompt to user)
params.set_param("dxfShowDialog", False)
# Preserve the DXF layers (makes the checking of document contents easier)
params.set_param("dxfUseDraftVisGroups", True)
# Use the new C++ importer -- that's where the bug was
params.set_param("dxfUseLegacyImporter", False)
# create simple part shapes (3 params)
# This is required to display the bug because creation of Draft objects clears out the
# pending exception this test is looking for, whereas creation of the simple shape object
# actually throws on the pending exception so the entity is absent from the document.
params.set_param("dxfCreatePart", True)
params.set_param("dxfCreateDraft", False)
params.set_param("dxfCreateSketch", False)
importDXF.insert(
FreeCAD.getHomePath() + "Mod/Test/TestData/DXFSample.dxf", "ImportedDocName"
)
finally:
params.set_param("dxfShowDialog", wasShowDialog)
params.set_param("dxfUseDraftVisGroups", wasUseLayers)
params.set_param("dxfUseLegacyImporter", wasUseLegacyImporter)
params.set_param("dxfCreatePart", wasCreatePart)
params.set_param("dxfCreateDraft", wasCreateDraft)
params.set_param("dxfCreateSketch", wasCreateSketch)
doc = FreeCAD.getDocument("ImportedDocName")
# This doc should have 3 objects: The Layers container, the DXF layer called 0, and one Line
self.assertEqual(len(doc.Objects), 3)
FreeCAD.closeDocument("ImportedDocName")
# class must be defined in global scope to allow it to be reloaded on document open
class SaveRestoreSpecialGroup:
def __init__(self, obj):