Skip to content

Commit

Permalink
Add sort query op test
Browse files Browse the repository at this point in the history
  • Loading branch information
munrojm committed Jun 11, 2024
1 parent 2084227 commit 4f058fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/api/test_query_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,15 @@ def test_numeric_query_serialization():

def test_sort_query_functionality():
op = SortQuery()

assert op.query(_sort_fields="volume,-density") == {"sort": {"volume": 1, "density": -1}}


def test_sort_query_fail():
op = SortQuery(max_num=1)
with pytest.raises(HTTPException):
op.query(_sort_fields="volume,-density")


def test_sort_serialization():
op = SortQuery()

Expand Down

0 comments on commit 4f058fe

Please sign in to comment.