def test_row_limit_on_non_select(over_limit): cli = PGCli() stmt = "UPDATE students SET name='Boby'" result = cli._should_limit_output(stmt, over_limit) assert result is False cli = PGCli(row_limit=0) result = cli._should_limit_output(stmt, over_limit) assert result is False
def test_row_limit_without_LIMIT_clause(LIMIT, over_limit): cli = PGCli(row_limit=LIMIT) stmt = "SELECT * FROM students" result = cli._should_limit_output(stmt, over_limit) assert result is True cli = PGCli(row_limit=0) result = cli._should_limit_output(stmt, over_limit) assert result is False