807 class __Test(_TypedParameterizable):
809 class __TestType(_SimpleParameterTypeBase):
810 def _isValid(self,value):
812 class __PSet(_ParameterTypeBase,_Parameterizable):
813 def __init__(self,*arg,**args):
815 _ParameterTypeBase.__init__(self)
816 _Parameterizable.__init__(self,*arg,**args)
821 x = __PSet(a = __TestType(4),
823 c = __PSet(gamma = __TestType(5))))
830 c = a.clone(x = dict(a=
None, c=
None))
831 self.assertEqual(a.t.value(),1)
832 self.assertEqual(a.u.value(),2)
833 self.assertEqual(b.t.value(),3)
834 self.assertEqual(b.u.value(),2)
835 self.assertEqual(b.v.value(),4)
836 self.assertEqual(b.x.a.value(),7)
837 self.assertEqual(b.x.b.value(),6)
838 self.assertEqual(b.x.c.gamma.value(),8)
839 self.assertEqual(b.x.d.value(),9)
840 self.assertEqual(hasattr(b,
"w"),
False)
841 self.assertEqual(hasattr(c.x,
"a"),
False)
842 self.assertEqual(hasattr(c.x,
"c"),
False)
843 self.assertRaises(TypeError,a.clone,
None,**{
"v":1})