@@ -157,8 +157,8 @@ def test_one_empty_internal_class(generate_classes):
157
157
assert generate_classes ([
158
158
schema .Class ("A" , pragmas = ["ql_internal" ])
159
159
]) == {
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 )),
162
162
}
163
163
164
164
@@ -202,11 +202,11 @@ def test_hierarchy_children(generate_children_implementations):
202
202
schema .Class ("C" , bases = ["A" ], derived = {"D" }, pragmas = ["ql_internal" ]),
203
203
schema .Class ("D" , bases = ["B" , "C" ]),
204
204
]) == ql .GetParentImplementation (
205
- classes = [a_ql_class (name = "A" , ql_internal = True ),
205
+ classes = [a_ql_class (name = "A" , internal = True ),
206
206
a_ql_class (name = "B" , bases = ["A" ], imports = [
207
207
stub_import_prefix + "A" ]),
208
208
a_ql_class (name = "C" , bases = ["A" ], imports = [
209
- stub_import_prefix + "A" ], ql_internal = True ),
209
+ stub_import_prefix + "A" ], internal = True ),
210
210
a_ql_class (name = "D" , final = True , bases = ["B" , "C" ],
211
211
imports = [stub_import_prefix + cls for cls in "BC" ]),
212
212
],
@@ -228,6 +228,21 @@ def test_single_property(generate_classes):
228
228
}
229
229
230
230
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
+
231
246
def test_children (generate_classes ):
232
247
assert generate_classes ([
233
248
schema .Class ("FakeRoot" ),
@@ -424,7 +439,8 @@ def test_class_dir(generate_classes):
424
439
schema .Class ("A" , derived = {"B" }, group = dir ),
425
440
schema .Class ("B" , bases = ["A" ]),
426
441
]) == {
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 ))),
428
444
"B.qll" : (a_ql_stub (name = "B" ),
429
445
a_ql_class (name = "B" , final = True , bases = ["A" ],
430
446
imports = [stub_import_prefix + "another.rel.path.A" ])),
@@ -878,9 +894,9 @@ def test_stub_on_class_with_synth_from_class(generate_classes):
878
894
ql .SynthUnderlyingAccessor (argument = "Entity" , type = "Raw::A" , constructorparams = ["result" ]),
879
895
]),
880
896
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
+ ])),
884
900
}
885
901
886
902
@@ -895,9 +911,9 @@ def test_stub_on_class_with_synth_on_arguments(generate_classes):
895
911
ql .SynthUnderlyingAccessor (argument = "Label" , type = "string" , constructorparams = ["_" , "_" , "result" ]),
896
912
]),
897
913
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
+ ])),
901
917
}
902
918
903
919
@@ -909,7 +925,8 @@ def test_synth_property(generate_classes):
909
925
"MyObject.qll" : (a_ql_stub (name = "MyObject" ),
910
926
a_ql_class (name = "MyObject" , final = True ,
911
927
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 ,
913
930
tableparams = ["this" , "result" ], doc = "foo of this my object" ),
914
931
])),
915
932
}
@@ -934,9 +951,10 @@ def test_hideable_property(generate_classes):
934
951
"Other.qll" : (a_ql_stub (name = "Other" ),
935
952
a_ql_class (name = "Other" , imports = [stub_import_prefix + "MyObject" ],
936
953
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
+ ])),
940
958
}
941
959
942
960
0 commit comments