Exemplo 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)
Exemplo n.º 2
0
 def test_sort_properties_to_tuple(self, params):
     assert sort_properties_to_tuple(params[0]) == params[1]
Exemplo 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", )
Exemplo 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]