@@ -157,8 +157,8 @@ def test_one_empty_internal_class(generate_classes):
157157 assert generate_classes ([
158158 schema .Class ("A" , pragmas = ["ql_internal" ])
159159 ]) == {
160- "A.qll" : (a_ql_stub (name = "A" , ql_internal = True ),
161- a_ql_class (name = "A" , final = True , ql_internal = True )),
160+ "A.qll" : (a_ql_stub (name = "A" , internal = True ),
161+ a_ql_class (name = "A" , final = True , internal = True )),
162162 }
163163
164164
@@ -202,11 +202,11 @@ def test_hierarchy_children(generate_children_implementations):
202202 schema .Class ("C" , bases = ["A" ], derived = {"D" }, pragmas = ["ql_internal" ]),
203203 schema .Class ("D" , bases = ["B" , "C" ]),
204204 ]) == ql .GetParentImplementation (
205- classes = [a_ql_class (name = "A" , ql_internal = True ),
205+ classes = [a_ql_class (name = "A" , internal = True ),
206206 a_ql_class (name = "B" , bases = ["A" ], imports = [
207207 stub_import_prefix + "A" ]),
208208 a_ql_class (name = "C" , bases = ["A" ], imports = [
209- stub_import_prefix + "A" ], ql_internal = True ),
209+ stub_import_prefix + "A" ], internal = True ),
210210 a_ql_class (name = "D" , final = True , bases = ["B" , "C" ],
211211 imports = [stub_import_prefix + cls for cls in "BC" ]),
212212 ],
@@ -228,6 +228,21 @@ def test_single_property(generate_classes):
228228 }
229229
230230
231+ def test_internal_property (generate_classes ):
232+ assert generate_classes ([
233+ schema .Class ("MyObject" , properties = [
234+ schema .SingleProperty ("foo" , "bar" , pragmas = ["ql_internal" ])]),
235+ ]) == {
236+ "MyObject.qll" : (a_ql_stub (name = "MyObject" ),
237+ a_ql_class (name = "MyObject" , final = True ,
238+ properties = [
239+ ql .Property (singular = "Foo" , type = "bar" , tablename = "my_objects" ,
240+ tableparams = ["this" , "result" ], doc = "foo of this my object" ,
241+ internal = True ),
242+ ])),
243+ }
244+
245+
231246def test_children (generate_classes ):
232247 assert generate_classes ([
233248 schema .Class ("FakeRoot" ),
@@ -424,7 +439,8 @@ def test_class_dir(generate_classes):
424439 schema .Class ("A" , derived = {"B" }, group = dir ),
425440 schema .Class ("B" , bases = ["A" ]),
426441 ]) == {
427- f"{ dir } /A.qll" : (a_ql_stub (name = "A" , import_prefix = "another.rel.path." ), a_ql_class (name = "A" , dir = pathlib .Path (dir ))),
442+ f"{ dir } /A.qll" : (
443+ a_ql_stub (name = "A" , import_prefix = "another.rel.path." ), a_ql_class (name = "A" , dir = pathlib .Path (dir ))),
428444 "B.qll" : (a_ql_stub (name = "B" ),
429445 a_ql_class (name = "B" , final = True , bases = ["A" ],
430446 imports = [stub_import_prefix + "another.rel.path.A" ])),
@@ -878,9 +894,9 @@ def test_stub_on_class_with_synth_from_class(generate_classes):
878894 ql .SynthUnderlyingAccessor (argument = "Entity" , type = "Raw::A" , constructorparams = ["result" ]),
879895 ]),
880896 a_ql_class (name = "MyObject" , final = True , properties = [
881- ql .Property (singular = "Foo" , type = "bar" , tablename = "my_objects" , synth = True ,
882- tableparams = ["this" , "result" ], doc = "foo of this my object" ),
883- ])),
897+ ql .Property (singular = "Foo" , type = "bar" , tablename = "my_objects" , synth = True ,
898+ tableparams = ["this" , "result" ], doc = "foo of this my object" ),
899+ ])),
884900 }
885901
886902
@@ -895,9 +911,9 @@ def test_stub_on_class_with_synth_on_arguments(generate_classes):
895911 ql .SynthUnderlyingAccessor (argument = "Label" , type = "string" , constructorparams = ["_" , "_" , "result" ]),
896912 ]),
897913 a_ql_class (name = "MyObject" , final = True , properties = [
898- ql .Property (singular = "Foo" , type = "bar" , tablename = "my_objects" , synth = True ,
899- tableparams = ["this" , "result" ], doc = "foo of this my object" ),
900- ])),
914+ ql .Property (singular = "Foo" , type = "bar" , tablename = "my_objects" , synth = True ,
915+ tableparams = ["this" , "result" ], doc = "foo of this my object" ),
916+ ])),
901917 }
902918
903919
@@ -909,7 +925,8 @@ def test_synth_property(generate_classes):
909925 "MyObject.qll" : (a_ql_stub (name = "MyObject" ),
910926 a_ql_class (name = "MyObject" , final = True ,
911927 properties = [
912- ql .Property (singular = "Foo" , type = "bar" , tablename = "my_objects" , synth = True ,
928+ ql .Property (singular = "Foo" , type = "bar" , tablename = "my_objects" ,
929+ synth = True ,
913930 tableparams = ["this" , "result" ], doc = "foo of this my object" ),
914931 ])),
915932 }
@@ -934,9 +951,10 @@ def test_hideable_property(generate_classes):
934951 "Other.qll" : (a_ql_stub (name = "Other" ),
935952 a_ql_class (name = "Other" , imports = [stub_import_prefix + "MyObject" ],
936953 final = True , properties = [
937- ql .Property (singular = "X" , type = "MyObject" , tablename = "others" , type_is_hideable = True ,
938- tableparams = ["this" , "result" ], doc = "x of this other" ),
939- ])),
954+ ql .Property (singular = "X" , type = "MyObject" , tablename = "others" ,
955+ type_is_hideable = True ,
956+ tableparams = ["this" , "result" ], doc = "x of this other" ),
957+ ])),
940958 }
941959
942960
0 commit comments