Skip to content

Commit

Permalink
Add enum test
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Sep 24, 2016
1 parent d7b5fbf commit 816d2ee
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Mod/Test/Document.py
Expand Up @@ -132,7 +132,7 @@ def testObjects(self):
except:
FreeCAD.Console.PrintLog(" exception thrown, OK\n")
else:
self.fail("no exeption thrown")
self.fail("no exception thrown")

#self.failUnless(L1.IntegerList == [4711] )
#f = L1.FloatList
Expand All @@ -146,6 +146,13 @@ def testObjects(self):
self.failUnless(L1.Label== "Label_2","Invalid object name")
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):
self.Doc.MemSize

Expand Down

0 comments on commit 816d2ee

Please sign in to comment.