Skip to content
Snippets Groups Projects
Commit e1ab3f41ec01 authored by Fabien Amarger's avatar Fabien Amarger
Browse files

test(projection): Add test for attribute and function projection attribute

parent 9de5a8022862
No related branches found
No related tags found
1 merge request!80feat(projection): Add attribute and function from entites for projection varaibles
......@@ -329,6 +329,19 @@
tree = self.parse("EUser X;")
self.assertEqual(tree.as_string(), "Any X WHERE X is EUser")
def test_projection_with_attribute_to_get(self):
tree = self.parse("Any X.my_attribute Where X is CWUser;")
varref = tree.children[0].selection[0]
self.assertTrue(isinstance(varref, nodes.VariableRefAttributeAccess))
self.assertEqual(varref.attribute_to_access, "my_attribute")
def test_projection_with_function_to_apply(self):
tree = self.parse('Any X.my_function("loutre") Where X is CWUser;')
varref = tree.children[0].selection[0]
self.assertTrue(isinstance(varref, nodes.VariableRefMethodCall))
self.assertEqual(varref.method_to_call, "my_function")
self.assertEqual(varref.args_for_method_to_call[0].value, "loutre")
def test_spec(self):
"""test all RQL string found in the specification and test they are well parsed"""
for rql in SPEC_QUERIES:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment