Skip to content
Snippets Groups Projects
Commit c10af0aeff19 authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

add non regression test

parent 4231935543c7
No related branches found
No related tags found
No related merge requests found
......@@ -110,9 +110,10 @@
('Student', ('Eetype',) ),
('Company', ('Eetype',) ),
('Address', ('Eetype',) ),
('Eetype', ('Eetype',) ),
)
),
'is_instance_of' : RelationSchema( ( ('Person', ('Eetype',) ),
('Student', ('Eetype',) ),
('Company', ('Eetype',) ),
('Address', ('Eetype',) ),
......@@ -113,9 +114,10 @@
)
),
'is_instance_of' : RelationSchema( ( ('Person', ('Eetype',) ),
('Student', ('Eetype',) ),
('Company', ('Eetype',) ),
('Address', ('Eetype',) ),
('Eetype', ('Eetype',) ),
)
),
'connait' : RelationSchema( (('Person', ('Person',) ),
......@@ -309,6 +311,22 @@
sols = sorted(node.children[0].solutions)
self.assertEquals(sols, [{'X': 'Company'}])
def test_non_regr_subjobj(self):
h = self.helper
def type_from_uid(name):
self.assertEquals(name, "Societe")
return 'Eetype'
uid_func_mapping = {'name': type_from_uid}
# constant as rhs of the uid relation
node = h.parse('Any X WHERE X name "Societe", X is ISOBJ, ISSIBJ is X')
h.compute_solutions(node, uid_func_mapping, debug=DEBUG)
sols = sorted(node.children[0].solutions)
self.assertEquals(sols, [{'X': 'Eetype', 'ISOBJ': 'Eetype', 'ISSIBJ': 'Address'},
{'X': 'Eetype', 'ISOBJ': 'Eetype', 'ISSIBJ': 'Company'},
{'X': 'Eetype', 'ISOBJ': 'Eetype', 'ISSIBJ': 'Eetype'},
{'X': 'Eetype', 'ISOBJ': 'Eetype', 'ISSIBJ': 'Person'},
{'X': 'Eetype', 'ISOBJ': 'Eetype', 'ISSIBJ': 'Student'}])
def test_unusableuid_func_mapping(self):
h = self.helper
......
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