# Path: dividebatur/aecdata/utils.py
# def ticket_sort_key(ticket):
#     "sort key for an ATL ticket, eg. A..Z, AA..ZZ"
#     return (len(ticket), ticket)


from ..aecdata.utils import ticket_sort_key


def apply_ticket_sort(items):
    return list(sorted(items, key=ticket_sort_key))


def test_a_c_already_sorted():
    assert(apply_ticket_sort(['A', 'B', 'C']) == ['A', 'B', 'C'])


def test_a_c_reversed():
    assert(apply_ticket_sort(['C', 'B', 'A']) == ['A', 'B', 'C'])


def test_a_c_aa_reversed():

# Path: dividebatur/aecdata/utils.py
# def ticket_sort_key(ticket):
#     "sort key for an ATL ticket, eg. A..Z, AA..ZZ"
#     return (len(ticket), ticket)


# Path: dividebatur/tests/test_ticket_sort_key.py
from ..aecdata.utils import ticket_sort_key



def apply_ticket_sort(items):
    return list(sorted(items, key=ticket_sort_key))


def test_a_c_already_sorted():
    assert(apply_ticket_sort(['A', 'B', 'C']) == ['A', 'B', 'C'])


def test_a_c_reversed():
    assert(apply_ticket_sort(['C', 'B', 'A']) == ['A', 'B', 'C'])


def test_a_c_aa_reversed():

    assert(apply_ticket_sort(['AA', 'C', 'B', 'A']) == ['A', 'B', 'C', 'AA'])