def test_return_sorted_collection_by_strings(): sorted_collection = return_sorted_collection('name', COLLECTION) assert ( 'Betty', 'Don', 'Joan', 'Peggy', 'Pete', 'Roger' ) == tuple((i['name'] for i in sorted_collection))
def test_return_sorted_collection_if_key_is_none(): assert COLLECTION == return_sorted_collection(None, COLLECTION)
def test_return_sorted_collection_by_ints(): sorted_collection = return_sorted_collection('id', COLLECTION) assert (1, 2, 3, 4, 5, 6) == tuple((i['id'] for i in sorted_collection))