def test_init_with_queries(self): root = TemplateSelectNode(queries=[ Query(TemplateWordNode("subj"), TemplateWordNode("pred"), TemplateWordNode("obj")) ]) self.assertEqual(1, len(root.queries)) self.assertEqual(0, len(root.vars)) self.assertEqual( "<select><q><subj>subj</subj><pred>pred</pred><obj>obj</obj></q></select>", root.to_xml(self._client_context))
def test_init(self): root = TemplateSelectNode() self.assertEqual([], root.queries) self.assertEqual([], root.vars) self.assertEqual("<select></select>", root.to_xml(self._client_context))