Commit 666d51d9 authored by François Ferry's avatar François Ferry
Browse files

revert(test): take back RemoveUnusedSolutionsTC from 615f5fbf8718

parent f15cce27fd4e
Pipeline #36126 passed with stage
......@@ -2016,5 +2016,29 @@ WHERE _Y.cw_creation_date>(DATETIME(_X.cw_creation_date, "+10 days"))'''),
self._check(rql, sql)
class RemoveUnsusedSolutionsTC(unittest.TestCase):
def test_invariant_not_varying(self):
rqlst = mock_object(defined_vars={})
rqlst.defined_vars['A'] = mock_object(scope=rqlst, stinfo={}, _q_invariant=True)
rqlst.defined_vars['B'] = mock_object(scope=rqlst, stinfo={}, _q_invariant=False)
self.assertEqual(
rql2sql.remove_unused_solutions(rqlst, [{'A': 'RugbyGroup', 'B': 'RugbyTeam'},
{'A': 'FootGroup', 'B': 'FootTeam'}], None),
([{'A': 'RugbyGroup', 'B': 'RugbyTeam'},
{'A': 'FootGroup', 'B': 'FootTeam'}],
{}, set('B'))
)
def test_invariant_varying(self):
rqlst = mock_object(defined_vars={})
rqlst.defined_vars['A'] = mock_object(scope=rqlst, stinfo={}, _q_invariant=True)
rqlst.defined_vars['B'] = mock_object(scope=rqlst, stinfo={}, _q_invariant=False)
self.assertEqual(
rql2sql.remove_unused_solutions(rqlst, [{'A': 'RugbyGroup', 'B': 'RugbyTeam'},
{'A': 'FootGroup', 'B': 'RugbyTeam'}], None),
([{'A': 'RugbyGroup', 'B': 'RugbyTeam'}], {}, set())
)
if __name__ == '__main__':
unittest.main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment