# Path: pyeqs/dsl/sort.py
# class Sort(dict):
# 
#     def __init__(self, field, order="asc", mode=None, missing=None, location=None):
#         super(Sort, self).__init__()
#         self.field = field
#         self.order = order
#         self.mode = mode
#         self.missing = missing
#         self.location = location
#         self._build_dict()
# 
#     def _build_dict(self):
#         sorting = {}
#         sorting["order"] = self.order
#         if self.mode:
#             sorting["mode"] = self.mode
#         if self.missing:
#             sorting["missing"] = self.missing
#         if self.location is not None:
#             sorting[self.field] = self.location
#             self["_geo_distance"] = sorting
#         else:
#             self[self.field] = sorting
# 
# Path: tests/helpers.py
# def homogeneous(a, b):
#     json.dumps(a, sort_keys=True).should.equal(json.dumps(b, sort_keys=True))


from pyeqs.dsl import Sort
from tests.helpers import homogeneous
        "foo": {
            "order": "asc"
        }
    }

    homogeneous(t, results)


def test_add_sort_desc():
    """
    Create Sort Block Descending
    """
    # When add a Sort block
    t = Sort("foo", order="dsc")

    # Then I see the appropriate JSON
    results = {
        "foo": {
            "order": "dsc"
        }
    }

    homogeneous(t, results)


def test_add_sort_with_mode():
    """
    Create Sort Block with Mode
    """
    # When add a Sort block

# Path: pyeqs/dsl/sort.py
# class Sort(dict):
# 
#     def __init__(self, field, order="asc", mode=None, missing=None, location=None):
#         super(Sort, self).__init__()
#         self.field = field
#         self.order = order
#         self.mode = mode
#         self.missing = missing
#         self.location = location
#         self._build_dict()
# 
#     def _build_dict(self):
#         sorting = {}
#         sorting["order"] = self.order
#         if self.mode:
#             sorting["mode"] = self.mode
#         if self.missing:
#             sorting["missing"] = self.missing
#         if self.location is not None:
#             sorting[self.field] = self.location
#             self["_geo_distance"] = sorting
#         else:
#             self[self.field] = sorting
# 
# Path: tests/helpers.py
# def homogeneous(a, b):
#     json.dumps(a, sort_keys=True).should.equal(json.dumps(b, sort_keys=True))


# Path: tests/unit/test_sort.py
from pyeqs.dsl import Sort
from tests.helpers import homogeneous

        "foo": {
            "order": "asc"
        }
    }

    homogeneous(t, results)


def test_add_sort_desc():
    """
    Create Sort Block Descending
    """
    # When add a Sort block
    t = Sort("foo", order="dsc")

    # Then I see the appropriate JSON
    results = {
        "foo": {
            "order": "dsc"
        }
    }

    homogeneous(t, results)


def test_add_sort_with_mode():
    """
    Create Sort Block with Mode
    """
    # When add a Sort block

    t = Sort("foo", mode="bar")