From cca62bd8b50adc0ec0e6f8d041764497d293afaa Mon Sep 17 00:00:00 2001 From: wmayer Date: Mon, 16 May 2022 11:29:18 +0200 Subject: [PATCH] Test: unit test for sub-objects related to PR #6888 --- src/Mod/Test/Document.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Mod/Test/Document.py b/src/Mod/Test/Document.py index 3b7ca66a33..904aea809a 100644 --- a/src/Mod/Test/Document.py +++ b/src/Mod/Test/Document.py @@ -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")