def test_ChildField_editor(self): a1 = self.TypedFieldTest(x=10, y=20) a2 = self.TypedFieldTest(x=3, y=4) b = self.ChildFieldTest(p=a1, q=[a2]) codeGen = Python2CodeGenerator('test') self.assertEqual(a1, b.p.getValueForEditor()) self.assertEqual([a2], b.q.getValueForEditor()) self.assertEqual( Py.Call(target=Py.Load(name='B'), args=[ Py.Call(target=Py.Load(name='A'), args=[ Py.IntLiteral(format='decimal', numType='int', value='10'), Py.IntLiteral(format='decimal', numType='int', value='20') ]), Py.ListLiteral(values=[ Py.Call(target=Py.Load(name='A'), args=[ Py.IntLiteral(format='decimal', numType='int', value='3'), Py.IntLiteral(format='decimal', numType='int', value='4') ]) ]) ]), b.__py_evalmodel__(codeGen))
def _py_evalmodel_forChildren(self, codeGen): return Py.ListLiteral( values=[x.__py_evalmodel__(codeGen) for x in self.children.nodes])
def test_ListLiteral(self): self._buildTest( Py.ListLiteral(values=[Py.Load( name='t'), Py.Load(name='v')]), ListLit([Load('t'), Load('v')]))
def build(self): return Py.ListLiteral(values=[x.build() for x in self.xs])
def __py_evalmodel__(self, codeGen): return Py.ListLiteral( values=[n.__py_evalmodel__(codeGen) for n in self.__live])