Skip to content

Commit

Permalink
testing for HAVING keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
at2706 committed Sep 22, 2023
1 parent a4d35d3 commit beff146
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/test_getting_columns.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,3 +461,20 @@ def test_aliases_switching_column_names():
parsed = Parser(query)
assert parsed.columns == ["a", "b"]
assert parsed.columns_dict == {"select": ["a", "b"]}


def test_having_columns():
query = """
SELECT Country
FROM Customers
GROUP BY Country
HAVING COUNT(CustomerID) > 5;
"""
parsed = Parser(query)
assert parsed.columns == ["Country", "CustomerID"]
print(parsed.columns_dict)
assert parsed.columns_dict == {
"select": ["Country"],
"group_by": ["Country"],
"having": ["CustomerID"],
}

0 comments on commit beff146

Please sign in to comment.