'Test for get sort parameters method
This test includes next test cases:
1) Verifies the default sort key and direction.
2) Verifies that the defaults can be overridden.
3) Verifies a single sort key and direction.
4) Verifies a single sort key and direction.
5) Verifies a single sort value with a default direction.
6) Verifies multiple sort parameter values.
7) Verifies multiple sort keys without all directions.
8) Verifies multiple sort keys and overriding default direction.
9) Verifies that leading and trailing spaces are removed.'

@ddt.data(({'params': {}}, ['created_at'], ['desc']), ({'params': {}, 'default_key': 'key1', 'default_dir': 'dir1'}, ['key1'], ['dir1']), ({'params': {'sort': 'key1:dir1'}}, ['key1'], ['dir1']), ({'params': {'sort_key': 'key1', 'sort_dir': 'dir1'}}, ['key1'], ['dir1']), ({'params': {'sort': 'key1'}}, ['key1'], ['desc']), ({'params': {'sort': 'key1:dir1,key2:dir2,key3:dir3'}}, ['key1', 'key2', 'key3'], ['dir1', 'dir2', 'dir3']), ({'params': {'sort': 'key1:dir1,key2,key3:dir3'}}, ['key1', 'key2', 'key3'], ['dir1', 'desc', 'dir3']), ({'params': {'sort': 'key1:dir1,key2,key3'}, 'default_dir': 'foo'}, ['key1', 'key2', 'key3'], ['dir1', 'foo', 'foo']), ({'params': {'sort': '    key1    :    dir1,key2:    dir2    ,    key3    '}}, ['key1', 'key2', 'key3'], ['dir1', 'dir2', 'desc']))
@ddt.unpack
def test_get_sort_params(self, parameters, expected_keys, expected_dirs):

    (sort_keys, sort_dirs) = common.get_sort_params(**parameters)
    self.assertEqual(expected_keys, sort_keys)
    self.assertEqual(expected_dirs, sort_dirs)
