def run(executor, sql, join=False): " Return string output for the sql to be run " result = [] for title, rows, headers, status in executor.run(sql): result.extend(format_output(title, rows, headers, status, 'psql', special.is_expanded_output())) if join: result = '\n'.join(result) return result
def run(executor, sql, join=False): """Return string output for the sql to be run.""" result = [] # TODO: this needs to go away. `run()` should not test formatted output. # It should test raw results. mycli = MyCli() for title, rows, headers, status in executor.run(sql): result.extend( mycli.format_output(title, rows, headers, status, special.is_expanded_output())) if join: result = '\n'.join(result) return result
def is_expanded_output(): """Pass-through for the tests.""" return special.is_expanded_output()