@@ -730,6 +730,11 @@ def test_all_in(self, initquery):
730730 expected = 'endAt=3&equalTo=2&limitToFirst=10&orderBy="{0}"&startAt=1' .format (order_by )
731731 assert query ._querystr == expected
732732
733+ def test_invalid_query_args (self ):
734+ ref = db .Reference (path = 'foo' )
735+ with pytest .raises (ValueError ):
736+ db .Query (order_by = '$key' , client = ref ._client , pathurl = ref ._add_suffix (), foo = 'bar' )
737+
733738
734739class TestSorter (object ):
735740 """Test cases for db._Sorter class."""
@@ -740,6 +745,7 @@ class TestSorter(object):
740745 ({'k1' : 3 , 'k2' : 1 , 'k3' : 2 }, ['k2' , 'k3' , 'k1' ]),
741746 ({'k1' : 3 , 'k2' : 1 , 'k3' : 1 }, ['k2' , 'k3' , 'k1' ]),
742747 ({'k1' : 1 , 'k2' : 2 , 'k3' : 1 }, ['k1' , 'k3' , 'k2' ]),
748+ ({'k1' : 2 , 'k2' : 2 , 'k3' : 1 }, ['k3' , 'k1' , 'k2' ]),
743749 ({'k1' : 'foo' , 'k2' : 'bar' , 'k3' : 'baz' }, ['k2' , 'k3' , 'k1' ]),
744750 ({'k1' : 'foo' , 'k2' : 'bar' , 'k3' : 10 }, ['k3' , 'k2' , 'k1' ]),
745751 ({'k1' : 'foo' , 'k2' : 'bar' , 'k3' : None }, ['k3' , 'k2' , 'k1' ]),
@@ -758,6 +764,8 @@ class TestSorter(object):
758764 ([1 , 2 , 3 ], [1 , 2 , 3 ]),
759765 ([3 , 2 , 1 ], [1 , 2 , 3 ]),
760766 ([1 , 3 , 2 ], [1 , 2 , 3 ]),
767+ ([1 , 3 , 3 ], [1 , 3 , 3 ]),
768+ ([2 , 3 , 2 ], [2 , 2 , 3 ]),
761769 (['foo' , 'bar' , 'baz' ], ['bar' , 'baz' , 'foo' ]),
762770 (['foo' , 1 , False , None , 0 , True ], [None , False , True , 0 , 1 , 'foo' ]),
763771 ]
0 commit comments