Test: unit test for sub-objects related to PR #6888

This commit is contained in:
wmayer
2022-05-16 11:29:18 +02:00
parent 65889b6c80
commit cca62bd8b5

View File

@@ -306,6 +306,17 @@ class DocumentBasicCases(unittest.TestCase):
self.assertEqual(obj.getSubObject(("XY_Plane", "YZ_Plane"), retType=4)[0], obj.getSubObject("XY_Plane", retType=4))
self.assertEqual(obj.getSubObject(("XY_Plane", "YZ_Plane"), retType=4)[1], obj.getSubObject("YZ_Plane", retType=4))
# Create a second origin object
obj2 = self.Doc.addObject("App::Origin", "Origin2")
self.Doc.recompute()
# Use the names of the origin's out-list
for i in obj2.OutList:
self.assertEqual(obj2.getSubObject(i.Name, retType=1).Name, i.Name)
# Add a '.' to the names
for i in obj2.OutList:
self.assertEqual(obj2.getSubObject(i.Name + '.', retType=1).Name, i.Name)
def testExtensions(self):
#we try to create a normal python object and add an extension to it
obj = self.Doc.addObject("App::DocumentObject", "Extension_1")