# -*- coding: utf-8 -*-

import autopath
from pyeole.sort import get_sort

import sys

if sys.version_info[0] < 3:
    def test_sort_func():
        """
            Test les fonctions de sort
        """
        liste = [{'key':1}, {'key':0}, {'key':5}, {'key':3}]
        sorted_list = [{'key':0}, {'key':1}, {'key':3}, {'key':5}]
        sort_func = get_sort('key')
        liste.sort(sort_func)
        assert liste == sorted_list
        liste = [{'key':'b'}, {'key':'a'}, {'key':'e'}, {'key':'c'}]
        sorted_list = [{'key':'a'}, {'key':'b'}, {'key':'c'}, {'key':'e'}]
        liste.sort(sort_func)
        assert liste == sorted_list
