Extensions: Fix ViewProvider python interface

This commit is contained in:
Stefan Tröger
2016-12-03 09:17:22 +01:00
committed by wmayer
parent bb81365cb6
commit 5ea603977f
4 changed files with 31 additions and 5 deletions

View File

@@ -234,7 +234,26 @@ class DocumentBasicCases(unittest.TestCase):
self.Doc.removeObject(obj.Name)
del obj
def testExtensionBugViewProvider(self):
class Layer():
def __init__(self, obj):
''' Add the properties '''
obj.addExtension("App::GroupExtensionPython", self)
class LayerViewProvider():
def __init__(self, obj):
''' Add the properties '''
obj.addExtension("Gui::ViewProviderGroupExtensionPython", self)
obj.Proxy = self
obj = FreeCAD.ActiveDocument.addObject("App::FeaturePython","Layer")
Layer(obj)
LayerViewProvider(obj.ViewObject)
self.failUnless(obj.hasExtension("App::GroupExtension"))
self.failUnless(obj.ViewObject.hasExtension("Gui::ViewProviderGroupExtension"))
self.failUnless(obj.ViewObject.hasExtension("Gui::ViewProviderGroupExtensionPython"))
def tearDown(self):
#closing doc
FreeCAD.closeDocument("CreateTest")