def test_simple_from(self): for tables, line in (({"dual" : "dual" }, "select * from dual"), ({"d" : "dual" }, "select * from dual d"), ({"dual" : "dual", "emp" : "emp" }, "select * from dual, emp"), ({"d" : "dual", "emp" : "emp" }, "select * from dual d, emp"), ({"dual" : "dual" }, "select * from dual where dummy='X'"), ({"dual" : "dual" }, "select * from dual order by 1"), ({"dual" : "dual" }, "select dummy, count(1) from dual group by dummy"),): self.failUnlessEqual(tables, pysqlhelpers.getFromClause(line))
def test_imbricated_from(self): for tables, line in (({"dual" : "dual" }, "select * from (select * from dual);"),): self.failUnlessEqual(tables, pysqlhelpers.getFromClause(line))