794 class __Test(_TypedParameterizable):
796 class __TestType(_SimpleParameterTypeBase):
797 def _isValid(self,value):
799 class __PSet(_ParameterTypeBase,_Parameterizable):
800 def __init__(self,*arg,**args):
802 _ParameterTypeBase.__init__(self)
803 _Parameterizable.__init__(self,*arg,**args)
808 x = __PSet(a = __TestType(4),
810 c = __PSet(gamma = __TestType(5))))
817 c = a.clone(x = dict(a=
None, c=
None))
818 self.assertEqual(a.t.value(),1)
819 self.assertEqual(a.u.value(),2)
820 self.assertEqual(b.t.value(),3)
821 self.assertEqual(b.u.value(),2)
822 self.assertEqual(b.v.value(),4)
823 self.assertEqual(b.x.a.value(),7)
824 self.assertEqual(b.x.b.value(),6)
825 self.assertEqual(b.x.c.gamma.value(),8)
826 self.assertEqual(b.x.d.value(),9)
827 self.assertEqual(hasattr(b,
"w"),
False)
828 self.assertEqual(hasattr(c.x,
"a"),
False)
829 self.assertEqual(hasattr(c.x,
"c"),
False)
830 self.assertRaises(TypeError,a.clone,
None,**{
"v":1})