]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
test sketch fix
authorasozinov <alexey.sozinov@opencascade.com>
Fri, 27 Jan 2023 10:57:50 +0000 (13:57 +0300)
committerasozinov <alexey.sozinov@opencascade.com>
Fri, 27 Jan 2023 10:57:50 +0000 (13:57 +0300)
src/SAMConverter/SAMConverter_SuggestConstraintsFeature.py
src/SAMConverter/Test/TestSAMConverter_Sketch.py

index b26355c4cea67d634ce9850c094797883f5fa56f..9f7f61ad2ffb15f3606ba5855b500d12e125cfff 100644 (file)
@@ -376,6 +376,7 @@ class SuggestConstraintsFeature(ModelAPI.ModelAPI_Feature):
             return
 
         predicted_list = ai_class_inst.Predict(self.exchange_sketch)
-        self.fillAttributes(predicted_list)
+        if salome.sg.hasDesktop():
+            self.fillAttributes(predicted_list)
 
         return predicted_list
index db9258f77fe2113138f1c9c73c10a46b5406a2cb..7273f7ce6c8b1933183a713f0d93d1462ffa4063 100644 (file)
@@ -36,13 +36,11 @@ from SAMConverter_ConvertConstraints import *
 from SAMConverter_ConvertPrimitives import *
 from SAMConverter_ConvertSketch import *
 
-def test_dictionary_valid(self, sketch_object_list, dictionary):
-    pass
-
 class TestConvertSketch(unittest.TestCase):
     def test_convert_sketch(self):
         model.begin()
         partSet = model.moduleDocument()
+        Part_1 = model.addPart(partSet)
         Part_1_doc = Part_1.document()
 
         Sketch_1 = model.addSketch(Part_1_doc, model.defaultPlane("XOZ"))
@@ -73,7 +71,9 @@ class TestConvertSketch(unittest.TestCase):
         object_list.append(SketchRadius_1)
         object_list.append(SketchRadius_2)
 
-        exchange_elements, dictionary = SAMConverter_ConvertSketch.convert_sketch(Sketch_1)
+        exchange_elements, dictionary = convert_sketch(Sketch_1)
+
+        self.assertEqual(len(object_list), len(exchange_elements.sequence))