def test_sort_order_serialization_with_nested_path(self): sort_order = SortOrder('foo', mode='avg', nested_path='bar') self.assertEqual(sort_order.serialize(), {'foo': { 'nested_path': 'bar', 'mode': 'avg' }})
def test_sort_order_serialization_with_nested_path(self): sort_order = SortOrder('foo', mode='avg', nested_path='bar') self.assertEqual( sort_order.serialize(), {'foo': {'nested_path': 'bar', 'mode': 'avg'}} )
def test_sort_order_serialization_with_missing(self): sort_order = SortOrder('foo', missing='_last') self.assertEqual(sort_order.serialize(), {'foo': {'missing': '_last'}})
def test_sort_order_serialization_with_order(self): sort_order = SortOrder('foo', 'asc') self.assertEqual(sort_order.serialize(), {'foo': {'order': 'asc'}})
def test_sort_order_serialization(self): sort_order = SortOrder('foo') self.assertEqual(sort_order.serialize(), {'foo': {}})