@@ -861,25 +861,33 @@ def test_property_on_class_with_default_doc_name(generate_classes):
861861
862862def test_stub_on_class_with_ipa_from_class (generate_classes ):
863863 assert generate_classes ([
864- schema .Class ("MyObject" , ipa = schema .IpaInfo (from_class = "A" )),
864+ schema .Class ("MyObject" , ipa = schema .IpaInfo (from_class = "A" ),
865+ properties = [schema .SingleProperty ("foo" , "bar" )]),
865866 ]) == {
866867 "MyObject.qll" : (a_ql_stub (name = "MyObject" , base_import = gen_import_prefix + "MyObject" , ipa_accessors = [
867868 ql .IpaUnderlyingAccessor (argument = "Entity" , type = "Raw::A" , constructorparams = ["result" ]),
868869 ]),
869- a_ql_class (name = "MyObject" , final = True , ipa = True )),
870+ a_ql_class (name = "MyObject" , final = True , properties = [
871+ ql .Property (singular = "Foo" , type = "bar" , tablename = "my_objects" , synth = True ,
872+ tableparams = ["this" , "result" ], doc = "foo of this my object" ),
873+ ])),
870874 }
871875
872876
873877def test_stub_on_class_with_ipa_on_arguments (generate_classes ):
874878 assert generate_classes ([
875- schema .Class ("MyObject" , ipa = schema .IpaInfo (on_arguments = {"base" : "A" , "index" : "int" , "label" : "string" })),
879+ schema .Class ("MyObject" , ipa = schema .IpaInfo (on_arguments = {"base" : "A" , "index" : "int" , "label" : "string" }),
880+ properties = [schema .SingleProperty ("foo" , "bar" )]),
876881 ]) == {
877882 "MyObject.qll" : (a_ql_stub (name = "MyObject" , base_import = gen_import_prefix + "MyObject" , ipa_accessors = [
878883 ql .IpaUnderlyingAccessor (argument = "Base" , type = "Raw::A" , constructorparams = ["result" , "_" , "_" ]),
879884 ql .IpaUnderlyingAccessor (argument = "Index" , type = "int" , constructorparams = ["_" , "result" , "_" ]),
880885 ql .IpaUnderlyingAccessor (argument = "Label" , type = "string" , constructorparams = ["_" , "_" , "result" ]),
881886 ]),
882- a_ql_class (name = "MyObject" , final = True , ipa = True )),
887+ a_ql_class (name = "MyObject" , final = True , properties = [
888+ ql .Property (singular = "Foo" , type = "bar" , tablename = "my_objects" , synth = True ,
889+ tableparams = ["this" , "result" ], doc = "foo of this my object" ),
890+ ])),
883891 }
884892
885893
0 commit comments