Add enum test

This commit is contained in:
wmayer 2016-09-24 16:47:41 +02:00
parent d7b5fbf214
commit 816d2ee288

View File

@ -132,7 +132,7 @@ class DocumentBasicCases(unittest.TestCase):
except: except:
FreeCAD.Console.PrintLog(" exception thrown, OK\n") FreeCAD.Console.PrintLog(" exception thrown, OK\n")
else: else:
self.fail("no exeption thrown") self.fail("no exception thrown")
#self.failUnless(L1.IntegerList == [4711] ) #self.failUnless(L1.IntegerList == [4711] )
#f = L1.FloatList #f = L1.FloatList
@ -146,6 +146,13 @@ class DocumentBasicCases(unittest.TestCase):
self.failUnless(L1.Label== "Label_2","Invalid object name") self.failUnless(L1.Label== "Label_2","Invalid object name")
self.Doc.removeObject("Label_1") self.Doc.removeObject("Label_1")
def testEnum(self):
enumeration_choices = ["one", "two"]
obj = self.Doc.addObject("App::FeaturePython","Label_2")
obj.addProperty("App::PropertyEnumeration", "myEnumeration", "Enum", "mytest")
with self.assertRaises(FreeCAD.Base.FreeCADError):
obj.myEnumeration = enumeration_choices[0]
def testMem(self): def testMem(self):
self.Doc.MemSize self.Doc.MemSize