Esempio n. 1
0
 def test_sort_properties_to_tuple_keyerror(self, bad_params):
     with pytest.raises(bad_params[1]) as excinfo:
         sort_properties_to_tuple(bad_params[0])
     assert bad_params[2] in str(excinfo.value)
Esempio n. 2
0
 def test_sort_properties_to_tuple(self, params):
     assert sort_properties_to_tuple(params[0]) == params[1]
Esempio n. 3
0
 def test_sort_properties_to_tuple_custom(self):
     to_sort = [{"foo": 1, "bar": "abc"}]
     sort_by = "foo"
     pick_by = "bar"
     assert sort_properties_to_tuple(to_sort, sort_by, pick_by) == ("abc", )
Esempio n. 4
0
 def test_sort_properties_to_tuple_custom(self, params):
     assert sort_properties_to_tuple(
         params[0], params[0][0].keys()[0],
         params[0][0].keys()[1]) == params[1]