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