def edges(selected_letters):
    return [
        {
            'node': {
                'id': base64('Letter:%s' % l.id),
                'letter': l.letter
            },
            'cursor': base64('sc:%s' % l.id)
        }
        for l in [letters[i] for i in selected_letters]
    ]
def cursor_for(ltr):
    l = letters[ltr]
    return base64('sc:%s' % l.id)
def test_returns_no_elements_if_cursors_cross():
    check('before: "{}" after: "{}"'.format(base64('sc:%s' % 2), base64('sc:%s' % 4)), '')
def test_returns_all_elements_if_cursors_are_on_the_outside():
    check('before: "{}" after: "{}"'.format(base64('sc:%s' % 6), base64('sc:%s' % 0)), 'ABCDE')